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

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

主站蜘蛛池模板: 长子县| 冕宁县| 中山市| 土默特右旗| 福海县| 大姚县| 博野县| 咸宁市| 贺兰县| 三门县| 县级市| 阿城市| 青州市| 乌恰县| 铁岭市| 集贤县| 雷山县| 永昌县| 万源市| 行唐县| 漾濞| 博客| 察雅县| 安新县| 中西区| 斗六市| 正宁县| 贵阳市| 徐闻县| 寻乌县| 图们市| 冀州市| 布拖县| 扎鲁特旗| 张家界市| 郓城县| 金湖县| 苏尼特左旗| 和龙市| 从化市| 永修县|