Scikit-learn
Python library for machine learning From Wikipedia, the free encyclopedia
scikit-learn (formerly scikits.learn and also known as sklearn) is a free and open-source machine learning library for the Python programming language.[3] It features various classification, regression and clustering algorithms including support-vector machines, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy. Scikit-learn is a NumFOCUS fiscally sponsored project.[4]
![]() | |
Original author(s) | David Cournapeau |
---|---|
Initial release | June 2007 |
Stable release | 1.6.1[1]
/ 10 January 2025 |
Repository | |
Written in | Python, Cython, C and C++[2] |
Operating system | Linux, macOS, Windows |
Type | Library for machine learning |
License | New BSD License |
Website | scikit-learn |
Overview
The scikit-learn project started as scikits.learn, a Google Summer of Code project by French data scientist David Cournapeau. The name of the project stems from the notion that it is a "SciKit" (SciPy Toolkit), a separately developed and distributed third-party extension to SciPy.[5] The original codebase was later rewritten by other developers.[who?] In 2010, contributors Fabian Pedregosa, Gaël Varoquaux, Alexandre Gramfort and Vincent Michel, from the French Institute for Research in Computer Science and Automation in Saclay, France, took leadership of the project and released the first public version of the library on February 1, 2010.[6] In November 2012, scikit-learn as well as scikit-image were described as two of the "well-maintained and popular" scikits libraries[update].[7] In 2019, it was noted that scikit-learn is one of the most popular machine learning libraries on GitHub.[8]
Features
- Large catalogue of well-established machine learning algorithms and data pre-processing methods (i.e. feature engineering)
- Utility methods for common data-science tasks, such as splitting data into train and test sets, cross-validation and grid search
- Consistent way of running machine learning models (
estimator.fit()
andestimator.predict()
), which libraries can implement - Declarative way of structuring a data science process (the
Pipeline
), including data pre-processing and model fitting
Examples
Fitting a random forest classifier:
>>> from sklearn.ensemble import RandomForestClassifier
>>> classifier = RandomForestClassifier(random_state=0)
>>> X = [[ 1, 2, 3], # 2 samples, 3 features
... [11, 12, 13]]
>>> y = [0, 1] # classes of each sample
>>> classifier.fit(X, y)
RandomForestClassifier(random_state=0)
Implementation
scikit-learn is largely written in Python, and uses NumPy extensively for high-performance linear algebra and array operations. Furthermore, some core algorithms are written in Cython to improve performance. Support vector machines are implemented by a Cython wrapper around LIBSVM; logistic regression and linear support vector machines by a similar wrapper around LIBLINEAR. In such cases, extending these methods with Python may not be possible.
scikit-learn integrates well with many other Python libraries, such as Matplotlib and plotly for plotting, NumPy for array vectorization, Pandas dataframes, SciPy, and many more.
Version history
scikit-learn was initially developed by David Cournapeau as a Google Summer of Code project in 2007. Later that year, Matthieu Brucher joined the project and started to use it as a part of his thesis work. In 2010, INRIA, the French Institute for Research in Computer Science and Automation, got involved and the first public release (v0.1 beta) was published in late January 2010.
- August 2013. scikit-learn 0.14[9]
- July 2014. scikit-learn 0.15.0[9]
- March 2015. scikit-learn 0.16.0[9]
- November 2015. scikit-learn 0.17.0[9]
- September 2016. scikit-learn 0.18.0
- July 2017. scikit-learn 0.19.0
- September 2018. scikit-learn 0.20.0[10]
- May 2019. scikit-learn 0.21.0[11]
- December 2019. scikit-learn 0.22[12]
- May 2020. scikit-learn 0.23.0[13]
- Jan 2021. scikit-learn 0.24[14]
- September 2021. scikit-learn 1.0.0[15]
- October 2021. scikit-learn 1.0.1[16]
- December 2021. scikit-learn 1.0.2[17]
- May 2022. scikit-learn 1.1.0[18]
- May 2022. scikit-learn 1.1.1[19]
- August 2022. scikit-learn 1.1.2[20]
- October 2022. scikit-learn 1.1.3[21]
- December 2022. scikit-learn 1.2.0[22]
- January 2023. scikit-learn 1.2.1[23]
- March 2023. scikit-learn 1.2.2[24]
Awards
scikit-learn alternatives
References
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.