我正在尝试将 cross_val_score() 应用于以下算法:
cgnet = algorithms.LevenbergMarquardt(
connection=[
layers.Input(XTrain.shape[1]),
layers.Linear(6),
layers.Linear(1)],
mu_update_factor=2,
mu=0.1,
shuffle_data=True,
verbose=True,
decay_rate=0.1,
addons=[algorithms.WeightElimination])
kfold = KFold(n_splits=5, shuffle=True, random_state=7)
scores=cross_val_score(cgnet, XTrainScaled,yTrainScaled,scoring='neg_mean_absolute_error',cv=kfold,verbose=10)
print scores
print("Accuracy: %0.2f (+/- %0.2f)" % (scores.mean(), scores.std() * 2))
这是我收到的错误消息:
TypeError: Cannot create a consistent method resolution
order (MRO) for bases LevenbergMarquardtWeightElimination, WeightElimination
没有 WeightElimination 或任何其他插件,cross_val_score() 可以正常工作……还有其他方法吗?谢谢