Zum Inhalt springen
LG4ML
  • Start
  • Idee
  • Projekte
  • Über uns
  • Wiki
  • Blog

Buzzwords

7
  • Transfer Learning
  • Machine Learning
  • Künstliche Intelligenz
  • Deep Learning
  • Data Science Workflow
  • Computer Vision
  • Big Data

Computer Vision

3
  • YOLOv4
  • Object Tracking
  • Frame Differencing

Grundlagen

14
  • Unüberwachtes Lernen
  • Überwachtes Lernen
  • Trainingsphase
  • Sampling
  • Regression
  • Preprocessing
  • Metrics
  • Klassifikation
  • Hyperparameter Tuning
  • Hyperparameter
  • Distanzmetriken
  • Data Science Workflow
  • Data Exploration
  • Cross Validation

Lernverfahren

8
  • Support Vector Machine
  • Principal Component Analysis
  • Perceptron
  • Logistische Regression
  • Lineare Regression
  • K-Nearest-Neighbours
  • K-Means
  • Decision Tree

Neuronale Netze

5
  • Verlustfunktion
  • Transfer Learning
  • Künstliches Neuron
  • Early Stopping
  • Aktivierungsfunktion

Preprocessing

8
  • Value Imputation
  • Scaling
  • Principal Component Analysis
  • Outlier Detection Basic
  • Outlier Detection Advanced
  • Frequenz Filter
  • Feature Engineering
  • Data Augmentation

Python Pakete

1
  • Data-Science Pakete
View Categories
  • Startseite
  • Docs
  • Grundlagen
  • Cross Validation

Cross Validation

2 min read

Cross Validation (zu deutsch Kreuzvalidierung) ist eine Methodik zur Evaluierung von Machine Learning Modellen und kommt daher in der Trainingsphase der Modelle zum Einsatz. Beim klassischen Lernsetup mit Trainings- und Testdaten (ggf. noch Validation) werden die Modelle auf den Trainingsdaten trainiert und mit den Testdaten evaluiert. Dabei sind die Ergebnisse stark vom Split der Daten abhängig und können je nach Menge der Daten stark variieren. Die Cross Validation verfolgt einen Ansatz, der in der folgenden Grafik verdeutlicht wird:

Genereller Aufbau der Cross-Validation

Der gesamte Datensatz wird dabei in Subsets unterteilt, die sogenannten Folds. Diese bleiben während der gesamten Trainingsphase dann gleich. Während der Cross-Validation wird das Modell entsprechend nach der Anzahl der Folds trainiert. Bei jedem Fold wird dann ein bestimmter Teil der Daten zum Evaluieren bzw. Testen des Modells verwendet, während die verbleibenden Daten zum Trainieren genutzt werden können. Für jeden Fold wird auf dem Testset die vorher festgelegte Metrik berechnet und gespeichert. Am Ende kann der Mittelwert gebildet werden, der die tatsächliche Performance des Modells sehr gut widerspiegelt und nicht rein vom Split der Daten abhängt. Durch die Berechnung der einzelnen Modelle ist die Cross-Validation jedoch zeit- und rechenintensiver als das Training mit nur einem einfachen Split der Daten. Jedoch können die Modelle meist parallel berechnet bzw. trainiert werden (falls genug Rechenleistung vorhanden ist), da die Ergebnisse in keiner Abhängigkeit zueinander stehen. Cross Validation ist auch bei kleineren Datensätzen ein sehr gutes Verfahren, um Modelle mit verschiedenen Testsätzen zu trainieren und damit aussagekräftige und zuverlässige Ergebnisse zu bekommen. 

Cross-Validation in Sklearn #

Der folgende Codeblock zeigt beispielhaft, wie die Cross Validation mit Sklearn in Python implementiert und genutzt werden kann:

from sklearn.svm import SVC
from sklearn.model_selection import cross_val_score

clf = SVC(kernel='linear', C=1, random_state=42)
scores = cross_val_score(clf, X, y, cv=5)

round(scores, 2)

# Output: 
array([0.81, 1.00 , 0.92, 0.85, 1.00 ])

Weiterführende Links:
Introduction to Cross Validation: https://machinelearningmastery.com/k-fold-cross-validation/
Why and how to Cross Validate a Model:
https://towardsdatascience.com/why-and-how-to-cross-validate-a-model-d6424b45261f
Verlässliche Ergebnisse mit Cross Validation:
https://neuroforge.de/ki-training-verlaessliche-ergebnisse-mit-cross-validation/ 

Updated on 12/03/2022

What are your Feelings

  • Happy
  • Normal
  • Sad
Share This Article :
  • Facebook
  • X
  • LinkedIn
  • Pinterest

Schreibe einen Kommentar Antworten abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Inhalt
  • Cross-Validation in Sklearn

LG4ML

Promoting Machine Learning from Lüneburg!

© 2025 LG4ML

Navigation

  • Kontakt
  • Datenschutzerklärung
  • Impressum

Folge uns auf

Github Slack Instagram

Made with 🍺 in Lüneburg.

Cookie-Hinweis
Wir verwenden Cookies auf unserer Website, um Ihnen die bestmögliche Erfahrung zu bieten, indem wir uns an Ihre Präferenzen und wiederholten Besuche erinnern. Wenn Sie auf "Alle akzeptieren" klicken, erklären Sie sich mit der Verwendung aller Cookies einverstanden. Sie können jedoch die Einstellungen besuchen, um eine kontrollierte Zustimmung zu erteilen.
EinstellungenAlle akzeptieren
Zustimmung verwalten

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
immer aktiv
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDauerBeschreibung
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SPEICHERN & AKZEPTIEREN