from Wikipedia, the free encyclopedia

Scikit learn logo small.svg
Basic data

developer David Cournapeau
Current  version 0.23.2
( August 4, 2020 )
operating system Platform independent
programming language Python , C , C ++ , Cython
License 3-clause BSD license

Scikit-learn (formerly scikits.learn) is a free software - library for machine learning for the programming language Python . It offers various classification , regression and clustering algorithms, including support vector machines , random forest , gradient boosting , k-means and DBSCAN . As SciKit (short for SciPy Toolkit), like Scikit-image , for example , it is based on the numerical and scientific Python libraries NumPy and SciPy .

This library is used in several German textbooks published in 2017.


Scikit-learn is largely written in Python. Some core algorithms were implemented in Cython for performance reasons. Support vector machines are implemented by a Cython wrapper around LIBSVM; logistic regression and linear support vector machines through a similar wrapper around LIBLINEAR.


Classification with the k-Nearest-Neighbor-Algorithm

The training data set is the Iris flower data set consisting of 50 observations each of three species of irises (Iris Setosa , Iris Virginica and Iris Versicolor ), on each of which four attributes of the flowers were recorded: the length and the width of the sepalum ( Sepal ) and the petalum ( petal ).

from sklearn import neighbors, datasets
iris = datasets.load_iris()
X, y =,
knn = neighbors.KNeighborsClassifier(n_neighbors=1), y)

print("Welche Art von Schwertlilie (Iris Setosa, Iris Virginica oder Iris Versicolor)")
print("hat ein 3cm x 5cm Sepalum (Kelchblatt) und ein 4cm x 2cm Petalum (Kronblatt)")
print("Antwort: ",iris.target_names[knn.predict([[3, 5, 4, 2]])])

A deep analysis of this data set with scikit-learn has been described in detail several times.

Web links

Individual evidence

  1. Release 0.23.2 . August 4, 2020 (accessed August 14, 2020).
  2. The scikit-learn Open Source Project on Open Hub: Languages ​​Page . In: Open Hub . (accessed on July 14, 2018).
  3. Andreas C. Müller, Sarah Guido: Introduction to Machine Learning with Python . O'Reilly-Verlag, Heidelberg 2017, ISBN 978-3-96009-049-6 .
  4. Sebastian Raschka: Machine Learning with Python . mitp-Verlag, Frechen 2017, ISBN 978-3-95845-422-4 .
  5. Matthias Parbel: Oliver Zeigermann: Interactive introduction to machine learning with Scikit-Learn. heise Developer, accessed on August 28, 2018 (German).
  6. Oliver Zeigermann: Jupyter Notebook on the lecture: Machine Learning with Scikit-Learn. Retrieved August 28, 2018 .
  7. Gael Varoquaux: 3.6. scikit-learn: machine learning in Python - Scipy lecture notes. In: Tutorials on the scientific Python ecosystem: a quick introduction to central tools and techniques. Accessed August 28, 2018 .