Python进程出错:<type'异常。索引器'>:索引1超出大小为1的轴1的界限

2024-10-01 09:20:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我得写别人的代码,谁离开了公司,我不知道这最后一行应该怎么做?你知道吗?你知道吗

modele1 = RandomForestClassifier(n_estimators=96,
                              criterion= 'entropy',
                              random_state=2,
                              n_jobs=-1,
                              min_samples_leaf=100,
                              max_depth=20)  
modele_churn_1=modele1.fit(X_train, Y_churn_1_train)
Y_score_proba_churn_1 = modele_churn_1.predict_proba(X_test)[:,1] # this line throws the following error :

Error in Python process: : index 1 is out of bounds for axis 1 with size 1


Tags: 代码jobs公司trainrandomminentropystate