Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
RaúlGarreta
Tryolabs/ Fing Udelar
@raulgarreta
PyConUruguay 2012
 ¿Qué es AprendizajeAutomático (AA) ?
 ¿Qué se puede hacer conAA?
 Herramientasde AA en Python
 Ejemplos
 Subárea dentro de Inteligencia
Artificial.
 Estudia algoritmos que tienen la
capacidad de aprender a realizar una
tarea...
 Procesamientode Lenguaje Natural
 SpamFiltering
 VisiónArtificial
 Reconocimiento de Rostros
 OCR
 JugadoresArtificiales
 Data Mining
 Sistemas de Recomendación
 Y mucho, mucho más…
 Mejorar en una tarea T
 Respecto a una medida de performance P
 Basándoseen la experiencia E
 Supervisado
 Clasificación
▪ Árbolesde decisión
▪ Naive Bayes
▪ SVM
▪ …
 Regresión
▪ RedesNeuronales
▪ …
 NoSupervisa...
 T: clasificar mails en Spam / No Spam
 P: porcentaje de mails correctamente
clasificados
 E: ver una muestra de mails ...
 ¿Qué es lo que se aprende y cómo se modela?
 V: Mail-> {Spam, No Spam}
 V(m1) = Spam, si m1 es mail de spam
 V(m2) = ...
 ¿Con qué algoritmo se aprende?
 Esto muchas veces depende de la
representación/modeloque se va a utilizar
 Si modelo c...
 Qué tipo de entrenamiento se utiliza?
 Supervisado: tengo ejemplos etiquetados,
una base de mails ya clasificadoscomo s...
 FeatureSelection: cual es el input del algoritmo,
como represento un ejemplo, cuales son las
característicasimportantes ...
 Haymuchas opciones:
 Orange http://orange.biolab.si/
 NLTK http://nltk.org/
 Mlpy http://mlpy.sourceforge.net/
 Pyml...
 ¿Cómo implementarnuestro spam filter en
Pythonen 6 pasos sencillos?
 UtilizaremosScikit-learn
 Necesitamosrecolectar ejemplos de entrenamiento.
 Mails etiquetadoscomo spam / ham
 Exportar mis mails de mi cuenta de...
data_samples =
load_files(container_path='/path/to/messages',
shuffle=True)
SPLIT_PERC = 0.6
train_size = int(len(data_samples.data)*SPLIT_PERC)
data_train = data_samples.data[:train_size]
data_test...
vectorizer = TfidfVectorizer(sublinear_tf=True,
strip_accents='ascii')
x_train = vectorizer.fit_transform(data_train)
x_te...
classifier = MultinomialNB()
classifier.fit(x_train, y_train)
pred = classifier.predict(x_test)
metrics.precision_score(y_test, pred)
metrics.recall_score(y_test, pred)
metrics.f1_scor...
 Web:
 Scikit-learn
http://scikit-learn.org/stable/auto_examples
 Streamhacker.com
 Libros:
 NLTKbook,NLTK cookbook
...
¿Preguntas?
Upcoming SlideShare
Loading in …5
×

Aprendizaje Automático con Python

3,231 views

Published on

Breve introducción a Aprendizaje Automático con el lenguaje de programación Python.

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download Full doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download PDF EBOOK here { https://urlzs.com/UABbn } ......................................................................................................................... Download EPUB Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... Download doc Ebook here { https://urlzs.com/UABbn } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book that can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer that is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story That Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money That the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths that Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Aprendizaje Automático con Python

  1. 1. RaúlGarreta Tryolabs/ Fing Udelar @raulgarreta PyConUruguay 2012
  2. 2.  ¿Qué es AprendizajeAutomático (AA) ?  ¿Qué se puede hacer conAA?  Herramientasde AA en Python  Ejemplos
  3. 3.  Subárea dentro de Inteligencia Artificial.  Estudia algoritmos que tienen la capacidad de aprender a realizar una tarea automáticamente.  Mejoransu performance con la experiencia.  Permitenresolver tareascomplejas, cuya solución es muy difícil o imposible de realizar manualmente.  Aprendizaje como aspecto fundamentalen la Inteligencia.
  4. 4.  Procesamientode Lenguaje Natural  SpamFiltering
  5. 5.  VisiónArtificial  Reconocimiento de Rostros  OCR
  6. 6.  JugadoresArtificiales  Data Mining
  7. 7.  Sistemas de Recomendación  Y mucho, mucho más…
  8. 8.  Mejorar en una tarea T  Respecto a una medida de performance P  Basándoseen la experiencia E
  9. 9.  Supervisado  Clasificación ▪ Árbolesde decisión ▪ Naive Bayes ▪ SVM ▪ …  Regresión ▪ RedesNeuronales ▪ …  NoSupervisado  Clustering ▪ KNN ▪ SOM  PorRefuerzos  Temporal Difference
  10. 10.  T: clasificar mails en Spam / No Spam  P: porcentaje de mails correctamente clasificados  E: ver una muestra de mails clasificados manualmentepor el usuario como Spam / No Spam
  11. 11.  ¿Qué es lo que se aprende y cómo se modela?  V: Mail-> {Spam, No Spam}  V(m1) = Spam, si m1 es mail de spam  V(m2) = No Spam, si m2 es mail de interés  V = f(aparece la palabra “viagra”, el remitente está en mi lista de contactos?, #que aparece la palabra “compre”, …)  f = función lineal? Función polinomial de 2do grado? Red neuronal? Árbol de Decisión? …
  12. 12.  ¿Con qué algoritmo se aprende?  Esto muchas veces depende de la representación/modeloque se va a utilizar  Si modelo con una Red Neuronal -> puedo utilizar Backpropagation  Si modelo con un Árbol de Decisión -> puedo utilizar ID3  Si utilizo un modelo probabilístico -> estimar las probabilidades contando frecuencias.  …
  13. 13.  Qué tipo de entrenamiento se utiliza?  Supervisado: tengo ejemplos etiquetados, una base de mails ya clasificadoscomo spam / no spam.  Utilizoesta base como conjunto de entrenamiento.  Puedo particionar en entrenamiento/ testeo para aprender y testear respectivamente. Ejemplo:70% para entrenamiento,30% testeo
  14. 14.  FeatureSelection: cual es el input del algoritmo, como represento un ejemplo, cuales son las característicasimportantes a considerar para clasificar.  Medidas de Performance: ¿cómo sé si el sistema realmente funciona bien? ¿cómo sé si el sistema mejora si realizo modificaciones?  Train set /Testing set  Precision, Recall, Medida F  Matrizde Confusión
  15. 15.  Haymuchas opciones:  Orange http://orange.biolab.si/  NLTK http://nltk.org/  Mlpy http://mlpy.sourceforge.net/  Pyml http://pyml.sourceforge.net/  Pybrain http://pybrain.org/  Scikit-learn http://scikit-learn.org/
  16. 16.  ¿Cómo implementarnuestro spam filter en Pythonen 6 pasos sencillos?  UtilizaremosScikit-learn
  17. 17.  Necesitamosrecolectar ejemplos de entrenamiento.  Mails etiquetadoscomo spam / ham  Exportar mis mails de mi cuenta de gmail messages ham ham1.txt ham2.txt ... spam spam1.txt spam2.txt ...
  18. 18. data_samples = load_files(container_path='/path/to/messages', shuffle=True)
  19. 19. SPLIT_PERC = 0.6 train_size = int(len(data_samples.data)*SPLIT_PERC) data_train = data_samples.data[:train_size] data_test = data_samples.data[train_size:] y_train = data_samples.target[:train_size] y_test = data_samples.target[train_size:]
  20. 20. vectorizer = TfidfVectorizer(sublinear_tf=True, strip_accents='ascii') x_train = vectorizer.fit_transform(data_train) x_test = vectorizer.transform(data_test)
  21. 21. classifier = MultinomialNB() classifier.fit(x_train, y_train)
  22. 22. pred = classifier.predict(x_test) metrics.precision_score(y_test, pred) metrics.recall_score(y_test, pred) metrics.f1_score(y_test, pred) metrics.confusion_matrix(y_test, pred)
  23. 23.  Web:  Scikit-learn http://scikit-learn.org/stable/auto_examples  Streamhacker.com  Libros:  NLTKbook,NLTK cookbook  Machine Learning,Tom Mitchel  Cursos:  Udelar http://www.fing.edu.uy/inco/cursos/aprendaut/  StanfordUniversity https://www.coursera.org/course/ml  WashingtonUniversity https://www.coursera.org/course/machlearning
  24. 24. ¿Preguntas?

×