Python作业——sklearn Assignment

作业题目综述:

Python作业——sklearn Assignment


按步骤解题:

步骤1:

Python作业——sklearn Assignment

代码如下:

Python作业——sklearn Assignment

运行结果:

Python作业——sklearn Assignment


步骤2:

Python作业——sklearn Assignment

代码如下:

Python作业——sklearn Assignment

出现警告:(DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.

  "This module will be removed in 0.20.", DeprecationWarning))

运行结果:

Python作业——sklearn Assignment

Python作业——sklearn Assignment


步骤3:

Python作业——sklearn Assignment

代码如下:

Python作业——sklearn Assignment

(SVC中选择C值为1,随机森林分类中选择n检测值为10)

运行结果:

Python作业——sklearn Assignment

Python作业——sklearn Assignment


步骤4:

Python作业——sklearn Assignment

代码如下:

Python作业——sklearn Assignment

运行结果:

Python作业——sklearn Assignment