SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Maschinelles Lernen
mit Scikit-learn und Kaggle
Dr. B.Tödtli
Fernfachhochschule Schweiz (FFHS)
Maschinelles Lernen
mit Scikit-learn und Kaggle
Empfehlungssysteme
Bildverständnis
Bots, Agenten
Bots, Agenten
Programm
◼ Crashkurs Machine Learning
◼ Kaggle Competitions
◼ Kaggle-Kernels
◼ Diskussion: Einsatz im Gymnasialen Unterricht?
◼ Eignung?
◼ Nötige Anpassungen?
◼ Kontaktieren Sie mich! beat.toedtli@ffhs.ch
Bitte registrieren Sie sich bei kaggle.com
(für später)
◼ Praktisches Lernen von Machine Learning
◼ Austausch von Ideen und Erfahrungen
◼ Offene Datensätze, Tutorials
Machine Learning Crashkurs
Was ist Machine Learning?
◼ „Machine Learning ist im Wesentlichen curve fitting“
(F.Chollet)
◼ Lerne, aus vorhandenen Daten auf neue
Situationen zu verallgemeinern
◼ Trainingsset: (X,y)
◼ Lerne ein Modell
y=a·x+b
◼ Modellvorhersagen
auf Testset: (X,?)
Wichtige ML-Anwendungsklassen
◼ Überwachtes Lernen:
◼ Klassifikation: Hund oder Katz‘?
◼ Regression
◼ Unüberwachtes Lernen: „Daten Verstehen“
◼ Clustering
◼ Datenkompression
◼ Datengenerierung (~ Interpolation)
https://www.kaggle.com/uysimty/keras-cnn-dog-or-cat-classification
Unüberwachtes Lernen
◼ Paket in Python für maschinelles Lernen
◼ Methoden .fit(), .predict(): Lernen und Vorhersagen
◼ Eignung für Mittelstufe?
Scikit-Learn
◼ Paket in Python für maschinelles Lernen
◼ Methoden .fit(), .predict(): Lernen und Vorhersagen
◼ Eignung für Mittelstufe?
Scikit-Learn
◼ Siehe Workshop von U. Künzi und B.Keller:
„Scipy und Jupyter Lab für den Mathematikunterricht“
PandasMatplotlib
Jupyter notebook
Python NumPy
Scipy-Stack
Ein Beispiel für Maschinelles Lernen
◼ Datengenerierende Verteilung
◼ Datengenerierende Verteilung
◼ (Trainings-)Datenpunkte im Streudiagramm:
Ein Beispiel für Maschinelles Lernen
◼ Datengenerierende Verteilung
◼ (Trainings-)Datenpunkte im Streudiagramm
◼ Füge 10% Rauschen hinzu: „Falsch“ bezeichnete Datenpunkte
Ein Beispiel für Maschinelles Lernen
◼ Datengenerierende Verteilung
◼ (Trainings-)Datenpunkte im Streudiagramm
◼ Füge 10% Rauschen hinzu: „Falsch“ bezeichnete Datenpunkte
◼ Datengenerierende Verteilung in der Praxis fast immer unbekannt
Ein Beispiel für Maschinelles Lernen
Verallgemeinerung
◼ Trainingspunkte mit Label gegeben
◼ Wie sollen neue Testpunkte klassifiziert werden?
Supervised Learning,
überwachtes Lernen
Lernalgorithmus
mit Kostenfunktion
Finale Hypothese
Trainingsdaten
Völlig unbekannte
Zielfunktion
◼ Kostenfunktion: wie gut passt eine
Hypothese zu den Daten?
◼ Lernalgorithmus sucht bestmögliche
Hypothese
◼ Kostenfunktion definiert „bestmöglich“:
z.B. mittlere quadratische Abweichung
Hypothesenmenge
(z.B. alle kNN mit k=5)
(Z.B. Gradientenabstieg mit
Least-Squares-Kostenfunktion)
K-Nächste Nachbarn
◼ Welches Klassenlabel erhält ein neuer Datenpunkt?
◼ Das Selbe wie seine k nächsten Nachbarn!
K-Nächste Nachbarn
◼ Welches Klassenlabel erhält ein neuer Datenpunkt?
◼ Das Selbe wie seine k nächsten Nachbarn!
◼ Wieviele Nachbarn berücksichtigen?
Hyperparameter k
Underfitting !
Overfitting!
Overfitting bei Regression
◼ Fitte ein Polynom an Punkte
◼ Perfekter Fit an Trainingspunkte: schlechte Verallgemeinerung
Underfitting ! Overfitting!
Kaggle Competitions
Kaggle.com
◼ Maschinelles Lernen lernen!
◼ Datensätze, Tutorien, Diskussionsforen, …
◼ Kaggle Notebooks (mit Rechenkapazität)
◼ Kaggle InClass Competitions
Freie Datensätze
Freie Kursmaterialien auf Kaggle
◼ https://www.kaggle.com/learn/machine-learning
◼ Ca. 4h Materialien
◼ 19 Lektionen
◼ Level 1, Level 2
Diskussionsforen
Notebooks mit Rechenkapazität
◼ Kaggle Kernels: Cloud Computerumgebung
◼ Ziele:
◼ Austausch, Lernen, Kollaboration
◼ Reproduzierbarkeit
◼ Kernels für
◼ R,
◼ Python
◼ Jupyter Notebooks
https://www.kaggle.com/competitions
◼ Machine Learning Lernen durch Competitions: Erfahrungsaufbau
◼ Trainingsdatensatz mit korrektem Label
Testdatensatz mit unbekanntem Label
◼ Competitions: Lade Vorhersage auf Kaggle.com hoch
https://www.kaggle.com/competitions
Eigene Kaggle Competition hosten!
Private Kaggle Competitions
Private Kaggle Competitions
Kontaktieren
Sie
m
ich! beat.toedtli@
ffhs.ch
◼ An der Fernfachhochschule Schweiz in 3 Modulen eingesetzt
◼ Kontext Berufsweiterbildung in Data Science (MAS/CAS Web4B)
◼ Ziel: Praktische Erfahrung sammeln in Machine Learning
mit Python und Scikit-Learn
◼ „Die Kaggle-Competitions waren super, unbedingt beibehalten.“
Hochschul-
Unterrichtsbeispiel
Hochschul-
Unterrichtsbeispiel
◼ https://www.kaggle.com/c/daan-kreuz-kreis-plus
◼ Bilder:
◼ „Lösung“: Hauptkomponentenanalyse funktioniert gut
id,target
0,2
1,1
2,0
3,0
4,2
5,0
6,0
...
Kaggle Kernels
New Kernel
InClass Kaggle Competition
◼ Geben Sie den folgenden Link ein:
www.kaggle.com/c/oed19classification
oder
http://tinyurl.com/yye89e4v
◼ Klicken Sie auf Kernels
◼ Klicken Sie auf den „Demo-Notebook OED2019“
◼ Klicken Sie auf „Fork“, um Ihr eigenes editierbares Notebook zu erhalten
Demo-Kernel
◼ https://www.kaggle.com/c/oed19classification/overview
◼ Oder bit.ly/2TDz0Gu
Alternative Kaggle Competition:
Regression? (Zusatzmaterial)
◼ Suchen Sie nach „oed19“ oder geben Sie den folgenden Link ein:
https://www.kaggle.com/c/OED19-Regression
◼ Klicken Sie auf den „Demo_Kaggle_Submission“ Kernel
◼ Klicken Sie auf „Fork“,
um Ihr eigenes editierbares Notebook zu erhalten
InClass Kaggle Competition
(ohne Kernels)
◼ Alternativ: Laden Sie die Daten herunter und entpacken Sie sie.
◼ Das Jupyter Notebook lässt sich ebenfalls herunterladen:
Submission!
◼ Schreibe die Submission-Datei:
◼ Lade Datei hoch:
◼ Format: Titelzeile „Id,y“
An Competition mit Kernel
teilnehmen
◼ Bearbeiten Sie Ihr Notebook
◼ „Committen“ Sie es
Commit eines Kernels
◼ Speichern einer Version des Notebooks: Reproduzierbarkeit der Resultate!
An Competition mit Kernel
teilnehmen
◼ Committen Sie das Notebook
◼ Submitten Sie die Ausgabe Ihres Notebooks als Vorhersage für die
Competition
Bewertung im Wettbewerb
◼ Kompetitives Element: Wer ist wie gut?
◼ Viel wichtiger, aber oft geheim:
◼ Welche Methoden funktionieren gut?
Leaderboard: Wer gewinnt?
Erfahrungen aus dem
Hochschulunterricht:
Limitierte Anzahl Submissions
Erfahrungen aus dem
Hochschulunterricht:
Limitierte Anzahl Submissions
Hochschul-Unterrichtsbeispiel 1
◼ Kaggle-Suche nach
“male-daan-schnell-mal-klassifizieren“
◼ Lernziel hier: Relevante Features
sind nicht x und y, sondern
Danke für die Aufmerksamkeit!
◼ Kontakt: beat.toedtli@gmail.com
◼ Fragen?
Erstellen von Kaggle-Competitions

Weitere ähnliche Inhalte

Empfohlen

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Empfohlen (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Slides open education_day_2019_beat_toedtli