質問編集履歴
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
#
|
85
|
+
# 下記を試してみましたが上手くいかず。。。。
|
86
86
|
|
87
87
|
df.columns[skb.get_support()]
|
88
88
|
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -20,13 +20,13 @@
|
|
20
20
|
|
21
21
|
df = pd.read_csv('/Users/hoge/Desktop/ファイル名.csv')
|
22
22
|
|
23
|
-
d
|
23
|
+
data = np.array(df)
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
X = d
|
27
|
+
X = data[:,1:58]
|
28
28
|
|
29
|
-
y = d
|
29
|
+
y = data[:,0]
|
30
30
|
|
31
31
|
|
32
32
|
|
@@ -54,15 +54,29 @@
|
|
54
54
|
|
55
55
|
skb.get_support()
|
56
56
|
|
57
|
+
array([False, False, False, False, True, True, False, False, False,
|
58
|
+
|
59
|
+
True, True, True, False, True, False, False, False, False,
|
60
|
+
|
61
|
+
False, False, True, False, True, True, True, False, False,
|
62
|
+
|
63
|
+
False, True, False, False, True, True, False, True, False,
|
64
|
+
|
65
|
+
True, True, False, False, True, False, True, True, False,
|
66
|
+
|
67
|
+
False, False, False, False, False, False, False, False, False,
|
68
|
+
|
69
|
+
True, False])
|
57
70
|
|
58
71
|
|
72
|
+
|
59
|
-
# skb.get_support()で絞り込まれた
|
73
|
+
# skb.get_support()で絞り込まれたtrue,falseを名称で確認したい
|
60
74
|
|
61
75
|
|
62
76
|
|
63
77
|
# feature_namesが入っていないデータなのでおそらく仕方ない
|
64
78
|
|
65
|
-
d
|
79
|
+
data.feature_names[skb.get_support()]
|
66
80
|
|
67
81
|
AttributeError: 'numpy.ndarray' object has no attribute 'feature_names'
|
68
82
|
|
@@ -72,7 +86,7 @@
|
|
72
86
|
|
73
87
|
df.columns[skb.get_support()]
|
74
88
|
|
75
|
-
|
89
|
+
IndexError: boolean index did not match indexed array along dimension 0; dimension is 57 but corresponding boolean dimension is 56
|
76
90
|
|
77
91
|
|
78
92
|
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,9 +50,13 @@
|
|
50
50
|
|
51
51
|
|
52
52
|
|
53
|
-
# 絞り込まれた20
|
53
|
+
# 絞り込まれた20
|
54
54
|
|
55
55
|
skb.get_support()
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
# skb.get_support()で絞り込まれた列名(カラム名)を確認したい
|
56
60
|
|
57
61
|
|
58
62
|
|