質問編集履歴
4
誤字修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
# サンプルデータの追加
|
25
25
|
fetch_california_housing = fetch_california_housing()
|
26
|
-
X, y = fetch_california_housing
|
26
|
+
X, y = fetch_california_housing.data, fetch_california_housing.target
|
27
27
|
|
28
28
|
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)
|
29
29
|
|
3
コメント文を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
import pandas as pd
|
22
22
|
import time
|
23
23
|
|
24
|
-
# サンプル
|
24
|
+
# サンプルデータの追加
|
25
25
|
fetch_california_housing = fetch_california_housing()
|
26
26
|
X, y = fetch_california_housing .data, fetch_california_housing ston.target
|
27
27
|
|
2
ボストンデータが利用できないため、変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
```Python
|
14
14
|
|
15
15
|
import lightgbm as lgb
|
16
|
-
from sklearn.datasets import loa
|
16
|
+
from sklearn.datasets import fetch_california_housing
|
17
17
|
from sklearn.model_selection import GridSearchCV
|
18
18
|
from sklearn.metrics import mean_squared_error
|
19
19
|
from sklearn.model_selection import train_test_split
|
@@ -22,8 +22,8 @@
|
|
22
22
|
import time
|
23
23
|
|
24
24
|
# サンプルとしてロードボストンのデータとします。
|
25
|
-
|
25
|
+
fetch_california_housing = fetch_california_housing()
|
26
|
-
X, y =
|
26
|
+
X, y = fetch_california_housing .data, fetch_california_housing ston.target
|
27
27
|
|
28
28
|
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)
|
29
29
|
|
1
import文の追加。サンプルデータの追加。
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,7 +11,20 @@
|
|
11
11
|
### 該当のソースコード
|
12
12
|
|
13
13
|
```Python
|
14
|
+
|
15
|
+
import lightgbm as lgb
|
16
|
+
from sklearn.datasets import load_boston
|
17
|
+
from sklearn.model_selection import GridSearchCV
|
18
|
+
from sklearn.metrics import mean_squared_error
|
19
|
+
from sklearn.model_selection import train_test_split
|
20
|
+
import numpy as np
|
21
|
+
import pandas as pd
|
22
|
+
import time
|
23
|
+
|
14
|
-
#
|
24
|
+
# サンプルとしてロードボストンのデータとします。
|
25
|
+
boston = load_boston()
|
26
|
+
X, y = boston.data, boston.target
|
27
|
+
|
15
28
|
X_train, X_val, y_train, y_val = train_test_split(X, y, test_size=0.2, random_state=42)
|
16
29
|
|
17
30
|
|