Skip to content

Commit fd8e84b

Browse files
author
Igor Rukhovich
committed
handling mypy, at. 1
1 parent 340a628 commit fd8e84b

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

configs/temp.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"common": {
3+
"lib": "xgboost",
4+
"data-format": "pandas",
5+
"data-order": "F",
6+
"dtype": "float32",
7+
"algorithm": "gbt",
8+
"tree-method": "hist",
9+
"count-dmatrix":""
10+
},
11+
"cases": [
12+
{
13+
"dataset": [
14+
{
15+
"source": "csv",
16+
"name": "plasticc",
17+
"training":
18+
{
19+
"x": "data/plasticc_x_train.csv",
20+
"y": "data/plasticc_y_train.csv"
21+
}
22+
}
23+
],
24+
"n-estimators": 60,
25+
"objective": "multi:softprob",
26+
"max-depth": 7,
27+
"subsample": 0.7,
28+
"colsample-bytree": 0.7
29+
}
30+
]
31+
}

datasets/loader_clf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def airline_ohe(dataset_dir: Path) -> bool:
158158
X = df.drop('dep_delayed_15min', 1)
159159
y = df["dep_delayed_15min"]
160160

161-
y_num = np.where(y == "Y", 1, 0)
161+
y_num = np.where(np.array(y == "Y"), 1, 0)
162162

163163
sets.append(X)
164164
labels.append(y_num)
@@ -381,8 +381,8 @@ def gisette(dataset_dir: Path) -> bool:
381381
df_labels = pd.read_csv(filename_train_labels, header=None)
382382
num_train = 6000
383383
x_train_arr = df_train.iloc[:num_train].values
384-
x_train = pd.DataFrame(np.array([np.fromstring(
385-
elem[0], dtype=int, count=num_cols, sep=' ') for elem in x_train_arr]))
384+
x_train = pd.DataFrame(np.array([[np.fromstring(
385+
elem[0], dtype=int, count=num_cols, sep=' ') for elem in x_train_arr]]))
386386
y_train_arr = df_labels.iloc[:num_train].values
387387
y_train = pd.DataFrame((y_train_arr > 0).astype(int))
388388

@@ -391,9 +391,9 @@ def gisette(dataset_dir: Path) -> bool:
391391
df_labels = pd.read_csv(filename_test_labels, header=None)
392392
x_test_arr = df_test.iloc[:num_train].values
393393
x_test = pd.DataFrame(np.array(
394-
[np.fromstring(
394+
[[np.fromstring(
395395
elem[0],
396-
dtype=int, count=num_cols, sep=' ')
396+
dtype=int, count=num_cols, sep=' ')]
397397
for elem in x_test_arr]))
398398
y_test_arr = df_labels.iloc[:num_train].values
399399
y_test = pd.DataFrame((y_test_arr > 0).astype(int))

0 commit comments

Comments
 (0)