我想用Hyperopt进行数据的分类,但是遇见一个错误。
from hpsklearn import HyperoptEstimator
import pandas as pd
# 加载训练数据
train = pd.read_csv('train.csv', index_col='id')
# 加载验证数据
test = pd.read_csv('test.csv', index_col='id')
x_train=train.loc[:,"fixed acidity":"alcohol"]
y_train=train.loc[:,"quality"]
x_test=test.loc[:,"fixed acidity":"alcohol"]
y_test=test.loc[:,"quality"]
import numpy as np
# Load Data
# ...
# Create the estimator object
estim = HyperoptEstimator()
# Search the space of classifiers and preprocessing steps and their
# respective hyperparameters in sklearn to fit a model to the data
estim.fit(x_train,y_train)
# Make a prediction using the optimized model
prediction = estim.predict(y_train)
# Report the accuracy of the classifier on a given set of data
score = estim.score(x_test, y_test)
# Return instances of the classifier and preprocessing steps
model = estim.best_model()
问题出在(
estim.fit(x_train,y_train)
```)
这串代码上
显示的错误为
'numpy.random.mtrand.RandomState' object has no attribute 'integers'
不知道该怎么办,我搜索网上说是numpy版本不对,我尝试下载1.14.5版本numpy失败了,请问还有别的办法避免这个错误吗?数据集用的红酒数据集,或者大佬们有别的写代码方式用HyperOp方法跑出来吗?