TPOT:在COLAB中工作后,导出后最佳导出的管道(.py文件)在哪里?

时间:2019-07-04 15:46:12

标签: python-3.x machine-learning google-colaboratory tpot

我正在运行TPOT文档页面提供的MNIST数据集分类的示例。我正在使用Google Colab进行此操作,尽管如此,我仍然找不到训练后tpot检索到的具有最佳管道的代码。

您能帮我弄清楚这个.py文件的保存位置吗?

from tpot import TPOTClassifier
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split

digits = load_digits()
X_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target,
                                                    train_size=0.75, test_size=0.25)

tpot = TPOTClassifier(generations=5, population_size=50, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_mnist_pipeline.py')

1 个答案:

答案 0 :(得分:0)

它将在您的工作目录中。

在虚拟机上运行TPOT时,我也遇到了此问题。为此,我提交了一些代码,使您也可以导出到字符串。

使用:

print(tpot.export())

它将在屏幕?上显示管道代码