当我尝试在Jupyter笔记本中运行逻辑回归时,出现以下错误:
model=LogisticRegression()
scoring='accuracy'
results = cross_val_score(model, X, Y, cv=kfold, scoring=scoring)
print("Accuracy: %.3f (%.3f)") % (results.mean(), results.std())
TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'
答案 0 :(得分:1)
我相信你只是错过了最外层的包裹parens。试试这个。
print(("Accuracy: %.3f (%.3f)") % (results.mean(), results.std()))