官术网_书友最值得收藏!

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

主站蜘蛛池模板: 静安区| 元朗区| 神木县| 东阿县| 永昌县| 通化市| 乌兰浩特市| 襄城县| 西峡县| 衢州市| 石楼县| 迭部县| 郧西县| 鹿泉市| 滦南县| 达孜县| 高邑县| 台中县| 阿拉善左旗| 老河口市| 崇左市| 彩票| 舒城县| 连江县| 灌云县| 绥化市| 富裕县| 英超| 库尔勒市| 加查县| 海门市| 安泽县| 开化县| 城口县| 根河市| 舟山市| 碌曲县| 屯留县| 巴塘县| 东海县| 平潭县|