以下代码在我运行时引发错误:
model_ridge = lm.LogisticRegression(penalty='l2', dual=False, tol=0.0001, C=9081)
model_randomforest = RandomForestClassifier(n_estimators = 200)
pred_ridge = []
pred_randomforest = []
new_Y = []
for i in range(10):
indxs = np.arange(i, X.shape[0], 10)
indxs_to_fit = list(set(range(X.shape[0])) - set(np.arange(i, X.shape[0], 10)))
pred_ridge = pred_ridge + list(model_ridge.fit(X[indxs_to_fit,:1], y[indxs_to_fit,:1]).predict_proba(X[indxs,:1])[:,1])
pred_randomforest = pred_randomforest + list(model_randomforest.fit(X[indxs_to_fit,:], y[indxs_to_fit,:]).predict_proba(X[indxs,:])[:,1])
new_Y = new_Y + list(y[indxs,:])
这是错误:
^{pr2}$我不明白发生了什么事,你能帮我弄清楚我做错了什么吗?在
目前没有回答
相关问题 更多 >
编程相关推荐