- Learning Data Mining with Python(Second Edition)
- Robert Layton
- 231字
- 2021-07-02 23:40:05
scikit-learn estimators
Estimators that allows for the standardized implementation and testing of algorithms a common, lightweight interface for classifiers to follow. By using this interface, we can apply these tools to arbitrary classifiers, without needing to worry about how the algorithms work.
Estimators must have the following two important functions:
- fit(): This function performs the training of the algorithm - setting the values of internal parameters. The fit() takes two inputs, the training sample dataset and the corresponding classes for those samples.
- predict(): This the class of the testing samples that we provide as the only input. This function returns a NumPy array with the predictions of each input testing sample.
Most scikit-learn estimators use NumPy arrays or a related format for input and output. However this is by convention and not required to use the interface.
There are many estimators implemented in scikit-learn and more in other open source projects that use the same interface. These (SVM), random forests. We will use many
of these algorithms in later chapters. In this chapter, we will use the nearest neighbor
algorithm.
For this chapter, you will need to install a new library called matplotlib. The easiest way to install it is to use pip3, as you did in Chapter 1, Getting Started with Data Mining, to install scikit-learn:
$pip3 install matplotlib
If you have matplotlib, seek the official installation instructions at:
http://matplotlib.org/users/installing.html
- Python概率統(tǒng)計
- Learning ROS for Robotics Programming(Second Edition)
- PHP程序設(shè)計(慕課版)
- Building a RESTful Web Service with Spring
- 技術(shù)領(lǐng)導(dǎo)力:程序員如何才能帶團(tuán)隊
- 神經(jīng)網(wǎng)絡(luò)編程實戰(zhàn):Java語言實現(xiàn)(原書第2版)
- Hadoop+Spark大數(shù)據(jù)分析實戰(zhàn)
- 區(qū)塊鏈底層設(shè)計Java實戰(zhàn)
- 微前端設(shè)計與實現(xiàn)
- Getting Started with Electronic Projects
- Software Architecture with Python
- Clojure Data Structures and Algorithms Cookbook
- Parallel Programming with Python
- Mastering JavaScript Promises
- Unreal Engine Game Development Cookbook