質問編集履歴
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,12 +3,13 @@
|
|
3
3
|
best_paramsとbest_valueが実行するたびに違う結果が出てしまいます。
|
4
4
|
|
5
5
|
```ここに言語を入力
|
6
|
+
from sklearn.model_selection import train_test_split
|
6
7
|
from sklearn.datasets import load_iris
|
7
8
|
|
8
9
|
iris = load_iris()
|
9
10
|
X = iris.data
|
10
11
|
y = iris.target
|
11
|
-
X_train, X_test, y_train, y_test = train_test_split(X, y,
|
12
|
+
X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, test_size=0.3)
|
12
13
|
|
13
14
|
|
14
15
|
import optuna
|