我正在使用惊喜来执行交叉验证
def cross_v(data, folds=5):
algorithms = (SVD, KNNBasic, KNNWithMeans, NormalPredictor)
measures = ['RMSE', 'MAE']
for a in algorithms:
data.split(folds);
algo = a();
algo.fit(data)
我这样调用函数
data = Dataset.load_builtin('ml-100k')
multiple_cv(data)
我得到这个错误
Traceback (most recent call last):
File "/home/user/PycharmProjects/pac1/prueba.py", line 30, in <module>
multiple_cv(data)
File "/home/user/PycharmProjects/pac1/prueba.py", line 19, in multiple_cv
algo.fit(data)
File "surprise/prediction_algorithms/matrix_factorization.pyx", line 155, in surprise.prediction_algorithms.matrix_factorization.SVD.fit
File "surprise/prediction_algorithms/matrix_factorization.pyx", line 204, in surprise.prediction_algorithms.matrix_factorization.SVD.sgd
AttributeError: 'DatasetAutoFolds' object has no attribute 'global_mean'
我错过了什么??