必备!人工智能和数据科学的七大 Python 库( 七 )

17

18# Export the pipeline

19tpot.export('tpot_iris_pipeline.py')

我们在这里构建了一个非常基本的TPOT pipeline,它将尝试寻找最佳ML pipeline来预测iris.target。然后保存这个pipeline。之后,我们要做的就非常简单了——加载生成的.py文件,你将看到:

1importnumpyasnp

2fromsklearn.kernel_approximationimportRBFSampler

3fromsklearn.model_selectionimporttrain_test_split

4fromsklearn.pipelineimportmake_pipeline

5fromsklearn.treeimportDecisionTreeClassifier

6#NOTE:Make sure that the class is labeled 'class' in the data file

7tpot_data = http://www.veick.cn/news/np.recfromcsv('PATH/TO/DATA/FILE', delimiter='COLUMN_SEPARATOR', dtype=np.float64)

推荐阅读