第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

為每個(gè)分類器繪制圖

為每個(gè)分類器繪制圖

千萬里不及你 2021-04-08 18:15:32
這是我的kfolds代碼kf = KFold(class_label.shape[0], n_folds=5, shuffle=True). for train_index, test_index in kf:.print("Train:", train_index, "Validation:",test_index). X_train, X_test = np.array(x)[train_index], np.array(x)[test_index]. y_train, y_test = np.array(class_label)[train_index], np.array(class_label)[test_index]情節(jié)應(yīng)該看起來像這樣,但有10條線我想為每一折畫一條線,所以總共應(yīng)該有十條線:test_score = []. train_score = []. for depth in range(20):.     clf = DecisionTreeClassifier(max_depth = depth + 1).     clf.fit(X_train,y_train).     train_score.append(clf.score(X_train,y_train)).     test_score.append(clf.score(X_test,y_test)). plt.figure(figsize = (8,8)). plt.plot(range(20),train_score). plt.plot(range(20), test_score). plt.xlabel('Tree Depth'). plt.ylabel('Accuracy'). plt.legend(['Training set','Test set']). 
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 169 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)