遵循此处给出的所有步骤后,我已经安装了 tpot 机器学习库:http: //epistasislab.github.io/tpot/installing/
以下是我的简单源代码 [ https://github.com/EpistasisLab/tpot]:
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=20, verbosity=2)
tpot.fit(X_train, y_train)
print(tpot.score(X_test, y_test))
tpot.export('tpot_mnist_pipeline.py')
我收到以下错误:
Traceback (most recent call last):
File "test.py", line 1, in <module>
from tpot import TPOTClassifier
ModuleNotFoundError: No module named 'tpot'
我现在不确定是什么原因造成的。我检查了该模块的 GitHub 问题,并遵循了那里给出的所有解决方案。我正在使用通过 Homebrew 安装的 Max OS high Sierra 和 Python