SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
MusicMood 
Machine Learning in Automatic Music Mood Prediction 
Based on Song Lyrics 
Sebastian Raschka 
December 10, 2014
Music Mood Prediction 
• We like to listen to music [1][2] 
• Digital music libraries are growing 
• Recommendation system for happy music 
(clinics, restaurants ...) & genre selection 
[1] Thomas Schaefer, Peter Sedlmeier, Christine Sta ̈dtler, and David Huron. The psychological functions of music listening. Frontiers in psychology, 4, 2013. 
[2] Daniel Vaestfjaell. Emotion induction through music: A review of the musical mood induction procedure. Musicae Scientiae, 5(1 suppl):173–211, 2002.
Predictive Modeling 
Unsupervised 
learning 
Supervised 
learning 
Clustering Classification Regression 
Reinforcement 
learning 
Hidden Ranking 
Markov models 
DBSCAN on a toy dataset Naive Bayes on Iris (after LDA)
Supervised Learning In a Nutshell
Feature Extraction 
Feature Selection 
Normalization 
Dimensionality Reduction 
Raw Data Collection 
Pre-processing 
Sampling 
Supervised Learning 
- A Quick Overview 
Pre-processing Test Dataset 
New Data 
Training Dataset 
Training Learning 
Algorithms 
Post-Processing 
Cross Validation 
Final Classification/ 
Regression Model 
Refinement 
Prediction 
Split 
Supervised 
Learning 
Sebastian Raschka 2014 
Missing Data 
Prediction-error Metrics 
Model Selection 
Hyperparameter 
optimization 
This work is licensed under a Creative Commons Attribution 4.0 International License.
MusicMood - The Plan
The Dataset 
http://labrosa.ee.columbia.edu/millionsong/
Sampling 
Lyrics available? Lyrics in English? 
1000 songs 
for training 
200 songs 
for validation 
http://lyrics.wikia.com/Lyrics_Wiki Python NLTK
Mood Labels 
Downloading mood labels from Last.fm 
Manual labeling based on lyrics and listening 
sad if ... 
• Dark topic (killing, war, complaints about politics, ...) 
• Artist in sorrow (lost love, ...)
Word Clouds 
happy: 
sad:
A Short Introduction to 
Naive Bayes Classification
Naive Bayes - Why? 
• Small sample size, can outperform the more powerful 
alternatives [1] 
• "Eager learner" (on-line learning vs. batch learning) 
• Fast for classification and re-training 
• Success in Spam Filtering [2] 
• High accuracy for predicting positive and negative classes in 
a sentiment analysis of Twitter data [3] 
[1] Pedro Domingos and Michael Pazzani. On the optimality of the simple bayesian classifier under zero-one loss. Machine learning, 
29(2-3):103–130, 1997. 
[2] Mehran Sahami, Susan Dumais, David Heckerman, and Eric Horvitz. A bayesian approach to filtering junk e-mail. In Learning for 
Text Categorization: Papers from the 1998 workshop, volume 62, pages 98–105, 1998. 
[3] Alec Go, Richa Bhayani, and Lei Huang. Twitter sentiment classification using distant supervision. CS224N Project Report, Stanford, 
pages 1–12, 2009.
Bayes Classifiers 
It’s All About Posterior Probabilities 
objective function: maximize the posterior probability
The Prior Probability 
Maximum Likelihood Estimate (MLE)
The Effect of Priors on the Decision Boundary
Class-Conditional Probability 
Maximum Likelihood Estimate (MLE) 
"chance of observing feature given that it belongs to class " "
Evidence 
just a normalization factor, 
can be omitted in decision rule:
Naive Bayes Models 
Gaussian Naive Bayes 
for continuous variables
Naive Bayes Models 
Multi-variate Bernoulli Naive Bayes 
for binary features
Naive Bayes Models 
Multinomial Naive Bayes
Naive Bayes and 
Text Classification
Feature Vectors 
The Bag of Words Model
Tokenization and N-grams 
“a swimmer likes swimming thus he swims”
Stemming and Lemmatization 
Porter Stemming 
Lemmatization
Stop Word Removal
Term and Frequency
Term Frequency - Inverse Document Frequency (Tf-idf)
Grid Search and 10-fold Cross Validation 
to Optimize F1 
• TP = true positive (happy predicted as happy) 
• FP = false positive (sad predicted as happy) 
• FN = false negative (happy predicted as sad)
K-Fold Cross Validation
10-Fold Cross Validation After Grid Search 
(final model)
10-fold Cross Validation (mean ROC) 
Multinomial vs Multi-variate Bernoulli Naive Bayes
10-fold Cross Validation (mean ROC) 
Multinomial Naive Bayes & Hyperparameter Alpha
10-fold Cross Validation (mean ROC) 
Multinomial Naive Bayes & Vocabulary Size
10-fold Cross Validation (mean ROC) 
Multinomial Naive Bayes & Document Frequency Cut-off
10-fold Cross Validation (mean ROC) 
Multinomial Naive Bayes & N-gram Sequence Length
Contingency Tables of the Final Model 
training test
Live Demo 
http://sebastianraschka.com/ 
Webapps/musicmood.html
Future Plans 
• Growing a list of mood labels (majority rule). 
• Performance comparisons of different machine learning algorithms. 
• Genre prediction and selection based on sound.
Thank you!

Contenu connexe

En vedette

Building an Insight Machine - Strata DDBD 2015
Building an Insight Machine - Strata DDBD 2015Building an Insight Machine - Strata DDBD 2015
Building an Insight Machine - Strata DDBD 2015Domino Data Lab
 
Understanding Music Playlists
Understanding Music PlaylistsUnderstanding Music Playlists
Understanding Music PlaylistsKeunwoo Choi
 
L9. Real World Machine Learning - Cooking Predictions
L9. Real World Machine Learning - Cooking PredictionsL9. Real World Machine Learning - Cooking Predictions
L9. Real World Machine Learning - Cooking PredictionsMachine Learning Valencia
 
Deep Learning Meetup #5
Deep Learning Meetup #5Deep Learning Meetup #5
Deep Learning Meetup #5Aloïs Gruson
 
Predicting the Future with Azure Machine Learning
Predicting the Future with Azure Machine LearningPredicting the Future with Azure Machine Learning
Predicting the Future with Azure Machine LearningPaul Prae
 
A framework for emotion mining from text in online social networks(final)
A framework for emotion mining from text in online social networks(final)A framework for emotion mining from text in online social networks(final)
A framework for emotion mining from text in online social networks(final)es712
 
딥러닝 개요 (2015-05-09 KISTEP)
딥러닝 개요 (2015-05-09 KISTEP)딥러닝 개요 (2015-05-09 KISTEP)
딥러닝 개요 (2015-05-09 KISTEP)Keunwoo Choi
 
The rise of music science
The rise of music scienceThe rise of music science
The rise of music scienceAlistair Croll
 
"Introduction to Machine Learning and its Applications" at sapthgiri engineer...
"Introduction to Machine Learning and its Applications" at sapthgiri engineer..."Introduction to Machine Learning and its Applications" at sapthgiri engineer...
"Introduction to Machine Learning and its Applications" at sapthgiri engineer...Sachin Nagargoje
 
Machine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & OpportunitiesMachine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & OpportunitiesCodePolitan
 
Deep learning for music classification, 2016-05-24
Deep learning for music classification, 2016-05-24Deep learning for music classification, 2016-05-24
Deep learning for music classification, 2016-05-24Keunwoo Choi
 
Introduction to Data Mining for Newbies
Introduction to Data Mining for NewbiesIntroduction to Data Mining for Newbies
Introduction to Data Mining for NewbiesEunjeong (Lucy) Park
 
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016Keunwoo Choi
 
Deep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - OverviewDeep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - OverviewKeunwoo Choi
 
Emotion Detection from Text
Emotion Detection from TextEmotion Detection from Text
Emotion Detection from TextIJERD Editor
 
Emotion Detection in text
Emotion Detection in text Emotion Detection in text
Emotion Detection in text kashif kashif
 
Introduction to text classification using naive bayes
Introduction to text classification using naive bayesIntroduction to text classification using naive bayes
Introduction to text classification using naive bayesDhwaj Raj
 
Machine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to ClassificationMachine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to ClassificationPier Luca Lanzi
 

En vedette (20)

Building an Insight Machine - Strata DDBD 2015
Building an Insight Machine - Strata DDBD 2015Building an Insight Machine - Strata DDBD 2015
Building an Insight Machine - Strata DDBD 2015
 
L11. The Future of Machine Learning
L11. The Future of Machine LearningL11. The Future of Machine Learning
L11. The Future of Machine Learning
 
Understanding Music Playlists
Understanding Music PlaylistsUnderstanding Music Playlists
Understanding Music Playlists
 
L9. Real World Machine Learning - Cooking Predictions
L9. Real World Machine Learning - Cooking PredictionsL9. Real World Machine Learning - Cooking Predictions
L9. Real World Machine Learning - Cooking Predictions
 
Deep Learning Meetup #5
Deep Learning Meetup #5Deep Learning Meetup #5
Deep Learning Meetup #5
 
Predicting the Future with Azure Machine Learning
Predicting the Future with Azure Machine LearningPredicting the Future with Azure Machine Learning
Predicting the Future with Azure Machine Learning
 
A framework for emotion mining from text in online social networks(final)
A framework for emotion mining from text in online social networks(final)A framework for emotion mining from text in online social networks(final)
A framework for emotion mining from text in online social networks(final)
 
딥러닝 개요 (2015-05-09 KISTEP)
딥러닝 개요 (2015-05-09 KISTEP)딥러닝 개요 (2015-05-09 KISTEP)
딥러닝 개요 (2015-05-09 KISTEP)
 
The rise of music science
The rise of music scienceThe rise of music science
The rise of music science
 
Emotion mining in text
Emotion mining in textEmotion mining in text
Emotion mining in text
 
"Introduction to Machine Learning and its Applications" at sapthgiri engineer...
"Introduction to Machine Learning and its Applications" at sapthgiri engineer..."Introduction to Machine Learning and its Applications" at sapthgiri engineer...
"Introduction to Machine Learning and its Applications" at sapthgiri engineer...
 
Machine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & OpportunitiesMachine Learning - Challenges, Learnings & Opportunities
Machine Learning - Challenges, Learnings & Opportunities
 
Deep learning for music classification, 2016-05-24
Deep learning for music classification, 2016-05-24Deep learning for music classification, 2016-05-24
Deep learning for music classification, 2016-05-24
 
Introduction to Data Mining for Newbies
Introduction to Data Mining for NewbiesIntroduction to Data Mining for Newbies
Introduction to Data Mining for Newbies
 
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
Automatic Tagging using Deep Convolutional Neural Networks - ISMIR 2016
 
Deep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - OverviewDeep Convolutional Neural Networks - Overview
Deep Convolutional Neural Networks - Overview
 
Emotion Detection from Text
Emotion Detection from TextEmotion Detection from Text
Emotion Detection from Text
 
Emotion Detection in text
Emotion Detection in text Emotion Detection in text
Emotion Detection in text
 
Introduction to text classification using naive bayes
Introduction to text classification using naive bayesIntroduction to text classification using naive bayes
Introduction to text classification using naive bayes
 
Machine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to ClassificationMachine Learning and Data Mining: 10 Introduction to Classification
Machine Learning and Data Mining: 10 Introduction to Classification
 

Similaire à MusicMood - Machine Learning in Automatic Music Mood Prediction Based on Song Lyrics

Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.Sunil Kumar Kopparapu
 
GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018Nancy Garmer
 
Creating an Entertaining and Informative Music Visualization
Creating an Entertaining and Informative Music VisualizationCreating an Entertaining and Informative Music Visualization
Creating an Entertaining and Informative Music Visualizationicchp2012
 
Generating Adequate Distractors for Multiple-Choice Questions
Generating Adequate Distractors for Multiple-Choice QuestionsGenerating Adequate Distractors for Multiple-Choice Questions
Generating Adequate Distractors for Multiple-Choice QuestionsCheng Zhang
 
Big Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICS
Big Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICSBig Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICS
Big Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICSMatt Stubbs
 
Deep Distillation from Natural Language Text
Deep Distillation from Natural Language TextDeep Distillation from Natural Language Text
Deep Distillation from Natural Language TextNaveen Ashish
 
Quantitative and Qualitative Research Methods.pptx
Quantitative and Qualitative Research Methods.pptxQuantitative and Qualitative Research Methods.pptx
Quantitative and Qualitative Research Methods.pptxkiran513883
 
A SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUES
A SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUESA SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUES
A SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUESJournal For Research
 
Natural Language Visualization with Scattertext
Natural Language Visualization with ScattertextNatural Language Visualization with Scattertext
Natural Language Visualization with ScattertextJason Kessler
 
MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...
MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...
MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...Joe McCarthy
 
Zouaq wole2013
Zouaq wole2013Zouaq wole2013
Zouaq wole2013Amal Zouaq
 
Grammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy Gryshchuk
Grammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy GryshchukGrammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy Gryshchuk
Grammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy GryshchukGrammarly
 
Recognizing Emotions in Spontaneous Speech
Recognizing Emotions in Spontaneous SpeechRecognizing Emotions in Spontaneous Speech
Recognizing Emotions in Spontaneous SpeechSunil Kumar Kopparapu
 
Questioning examples
Questioning examplesQuestioning examples
Questioning examplesbdavis2014
 
Ms7005 interviewing(1)
Ms7005 interviewing(1)Ms7005 interviewing(1)
Ms7005 interviewing(1)Coffee Dai
 

Similaire à MusicMood - Machine Learning in Automatic Music Mood Prediction Based on Song Lyrics (20)

Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.Do you Mean what you say? Recognizing Emotions.
Do you Mean what you say? Recognizing Emotions.
 
GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018
 
GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018GradTrack: Getting Started with Statistics September 20, 2018
GradTrack: Getting Started with Statistics September 20, 2018
 
Creating an Entertaining and Informative Music Visualization
Creating an Entertaining and Informative Music VisualizationCreating an Entertaining and Informative Music Visualization
Creating an Entertaining and Informative Music Visualization
 
Generating Adequate Distractors for Multiple-Choice Questions
Generating Adequate Distractors for Multiple-Choice QuestionsGenerating Adequate Distractors for Multiple-Choice Questions
Generating Adequate Distractors for Multiple-Choice Questions
 
Big Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICS
Big Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICSBig Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICS
Big Data LDN 2018: PROMISE AND PITFALLS OF TEXT ANALYTICS
 
Deep Distillation from Natural Language Text
Deep Distillation from Natural Language TextDeep Distillation from Natural Language Text
Deep Distillation from Natural Language Text
 
Design vs Data
Design vs DataDesign vs Data
Design vs Data
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
Quantitative and Qualitative Research Methods.pptx
Quantitative and Qualitative Research Methods.pptxQuantitative and Qualitative Research Methods.pptx
Quantitative and Qualitative Research Methods.pptx
 
A SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUES
A SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUESA SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUES
A SURVEY OF SENTIMENT CLASSSIFICTION TECHNIQUES
 
Natural Language Visualization with Scattertext
Natural Language Visualization with ScattertextNatural Language Visualization with Scattertext
Natural Language Visualization with Scattertext
 
MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...
MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...
MusicFX: An Arbiter of Group Preferences for Computer Supported Collaborative...
 
Zouaq wole2013
Zouaq wole2013Zouaq wole2013
Zouaq wole2013
 
Week 2 PPT
Week 2 PPTWeek 2 PPT
Week 2 PPT
 
Grammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy Gryshchuk
Grammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy GryshchukGrammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy Gryshchuk
Grammarly Meetup: Paraphrase Detection in NLP (PART 2) - Andriy Gryshchuk
 
Recognizing Emotions in Spontaneous Speech
Recognizing Emotions in Spontaneous SpeechRecognizing Emotions in Spontaneous Speech
Recognizing Emotions in Spontaneous Speech
 
What is AI ML NLP and how to apply them
What is AI ML NLP and how to apply themWhat is AI ML NLP and how to apply them
What is AI ML NLP and how to apply them
 
Questioning examples
Questioning examplesQuestioning examples
Questioning examples
 
Ms7005 interviewing(1)
Ms7005 interviewing(1)Ms7005 interviewing(1)
Ms7005 interviewing(1)
 

Dernier

convolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfconvolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfSubhamKumar3239
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxSimranPal17
 
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...KarteekMane1
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfblazblazml
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 217djon017
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectBoston Institute of Analytics
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Cathrine Wilhelmsen
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024Susanna-Assunta Sansone
 
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxTasha Penwell
 
Cyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded dataCyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded dataTecnoIncentive
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Boston Institute of Analytics
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsVICTOR MAESTRE RAMIREZ
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesTimothy Spann
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxHaritikaChhatwal1
 
INTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processingINTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processingsocarem879
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our WorldEduminds Learning
 

Dernier (20)

convolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfconvolutional neural network and its applications.pdf
convolutional neural network and its applications.pdf
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
What To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptxWhat To Do For World Nature Conservation Day by Slidesgo.pptx
What To Do For World Nature Conservation Day by Slidesgo.pptx
 
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
wepik-insightful-infographics-a-data-visualization-overview-20240401133220kwr...
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
 
Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2Easter Eggs From Star Wars and in cars 1 and 2
Easter Eggs From Star Wars and in cars 1 and 2
 
Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
Decoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis ProjectDecoding Patterns: Customer Churn Prediction Data Analysis Project
Decoding Patterns: Customer Churn Prediction Data Analysis Project
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 
Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)Data Factory in Microsoft Fabric (MsBIP #82)
Data Factory in Microsoft Fabric (MsBIP #82)
 
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
FAIR, FAIRsharing, FAIR Cookbook and ELIXIR - Sansone SA - Boston 2024
 
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptxThe Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
The Power of Data-Driven Storytelling_ Unveiling the Layers of Insight.pptx
 
Cyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded dataCyber awareness ppt on the recorded data
Cyber awareness ppt on the recorded data
 
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
Data Analysis Project : Targeting the Right Customers, Presentation on Bank M...
 
Advanced Machine Learning for Business Professionals
Advanced Machine Learning for Business ProfessionalsAdvanced Machine Learning for Business Professionals
Advanced Machine Learning for Business Professionals
 
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming PipelinesConf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
Conf42-LLM_Adding Generative AI to Real-Time Streaming Pipelines
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
SMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptxSMOTE and K-Fold Cross Validation-Presentation.pptx
SMOTE and K-Fold Cross Validation-Presentation.pptx
 
INTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processingINTRODUCTION TO Natural language processing
INTRODUCTION TO Natural language processing
 
Learn How Data Science Changes Our World
Learn How Data Science Changes Our WorldLearn How Data Science Changes Our World
Learn How Data Science Changes Our World
 

MusicMood - Machine Learning in Automatic Music Mood Prediction Based on Song Lyrics

  • 1. MusicMood Machine Learning in Automatic Music Mood Prediction Based on Song Lyrics Sebastian Raschka December 10, 2014
  • 2. Music Mood Prediction • We like to listen to music [1][2] • Digital music libraries are growing • Recommendation system for happy music (clinics, restaurants ...) & genre selection [1] Thomas Schaefer, Peter Sedlmeier, Christine Sta ̈dtler, and David Huron. The psychological functions of music listening. Frontiers in psychology, 4, 2013. [2] Daniel Vaestfjaell. Emotion induction through music: A review of the musical mood induction procedure. Musicae Scientiae, 5(1 suppl):173–211, 2002.
  • 3. Predictive Modeling Unsupervised learning Supervised learning Clustering Classification Regression Reinforcement learning Hidden Ranking Markov models DBSCAN on a toy dataset Naive Bayes on Iris (after LDA)
  • 5. Feature Extraction Feature Selection Normalization Dimensionality Reduction Raw Data Collection Pre-processing Sampling Supervised Learning - A Quick Overview Pre-processing Test Dataset New Data Training Dataset Training Learning Algorithms Post-Processing Cross Validation Final Classification/ Regression Model Refinement Prediction Split Supervised Learning Sebastian Raschka 2014 Missing Data Prediction-error Metrics Model Selection Hyperparameter optimization This work is licensed under a Creative Commons Attribution 4.0 International License.
  • 8. Sampling Lyrics available? Lyrics in English? 1000 songs for training 200 songs for validation http://lyrics.wikia.com/Lyrics_Wiki Python NLTK
  • 9. Mood Labels Downloading mood labels from Last.fm Manual labeling based on lyrics and listening sad if ... • Dark topic (killing, war, complaints about politics, ...) • Artist in sorrow (lost love, ...)
  • 10.
  • 12. A Short Introduction to Naive Bayes Classification
  • 13. Naive Bayes - Why? • Small sample size, can outperform the more powerful alternatives [1] • "Eager learner" (on-line learning vs. batch learning) • Fast for classification and re-training • Success in Spam Filtering [2] • High accuracy for predicting positive and negative classes in a sentiment analysis of Twitter data [3] [1] Pedro Domingos and Michael Pazzani. On the optimality of the simple bayesian classifier under zero-one loss. Machine learning, 29(2-3):103–130, 1997. [2] Mehran Sahami, Susan Dumais, David Heckerman, and Eric Horvitz. A bayesian approach to filtering junk e-mail. In Learning for Text Categorization: Papers from the 1998 workshop, volume 62, pages 98–105, 1998. [3] Alec Go, Richa Bhayani, and Lei Huang. Twitter sentiment classification using distant supervision. CS224N Project Report, Stanford, pages 1–12, 2009.
  • 14. Bayes Classifiers It’s All About Posterior Probabilities objective function: maximize the posterior probability
  • 15. The Prior Probability Maximum Likelihood Estimate (MLE)
  • 16. The Effect of Priors on the Decision Boundary
  • 17. Class-Conditional Probability Maximum Likelihood Estimate (MLE) "chance of observing feature given that it belongs to class " "
  • 18. Evidence just a normalization factor, can be omitted in decision rule:
  • 19. Naive Bayes Models Gaussian Naive Bayes for continuous variables
  • 20. Naive Bayes Models Multi-variate Bernoulli Naive Bayes for binary features
  • 21. Naive Bayes Models Multinomial Naive Bayes
  • 22. Naive Bayes and Text Classification
  • 23. Feature Vectors The Bag of Words Model
  • 24. Tokenization and N-grams “a swimmer likes swimming thus he swims”
  • 25. Stemming and Lemmatization Porter Stemming Lemmatization
  • 28. Term Frequency - Inverse Document Frequency (Tf-idf)
  • 29. Grid Search and 10-fold Cross Validation to Optimize F1 • TP = true positive (happy predicted as happy) • FP = false positive (sad predicted as happy) • FN = false negative (happy predicted as sad)
  • 31. 10-Fold Cross Validation After Grid Search (final model)
  • 32. 10-fold Cross Validation (mean ROC) Multinomial vs Multi-variate Bernoulli Naive Bayes
  • 33. 10-fold Cross Validation (mean ROC) Multinomial Naive Bayes & Hyperparameter Alpha
  • 34. 10-fold Cross Validation (mean ROC) Multinomial Naive Bayes & Vocabulary Size
  • 35. 10-fold Cross Validation (mean ROC) Multinomial Naive Bayes & Document Frequency Cut-off
  • 36. 10-fold Cross Validation (mean ROC) Multinomial Naive Bayes & N-gram Sequence Length
  • 37. Contingency Tables of the Final Model training test
  • 38. Live Demo http://sebastianraschka.com/ Webapps/musicmood.html
  • 39. Future Plans • Growing a list of mood labels (majority rule). • Performance comparisons of different machine learning algorithms. • Genre prediction and selection based on sound.