質問編集履歴
1
SVMのコードを全文掲載しました
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,7 +14,13 @@
|
|
14
14
|
|
15
15
|
```python
|
16
16
|
ソースコード
|
17
|
+
AV_df = pd.read_csv("AV1.0~3.0 nomal2.csv")
|
18
|
+
x = AV_df.iloc[0:75, [0,1]].values
|
19
|
+
y = AV_df.iloc[0:75, 2].values
|
20
|
+
model = SVC(kernel = "rbf", random_state = 0, C = 10, gamma = 100 )
|
21
|
+
model.fit(x, y)
|
22
|
+
|
17
|
-
|
23
|
+
def plot_decision_regions(X, y, classifier, test_idx=None, resolution=0.02):
|
18
24
|
markers = ('s','x','o','^','v')
|
19
25
|
colors = ('red','blue','lightgreen','gray','cyan')
|
20
26
|
cmap = ListedColormap(colors[:len(np.unique(y))])
|
@@ -34,12 +40,15 @@
|
|
34
40
|
|
35
41
|
if test_idx:
|
36
42
|
X_test, y_test = X[test_idx, :], y[test_idx]
|
37
|
-
plt.scatter(X_test[:,0], X_test[:,1] ,c='', alpha=1.0, linewidth = 1, marker='o', s =55,label = 'test set')
|
43
|
+
plt.scatter(X_test[:,0], X_test[:,1] ,c='', alpha=1.0, linewidth = 1, marker='o', s =55,label = 'test set')
|
38
44
|
|
45
|
+
plot_decision_regions(x, y, classifier = model)
|
46
|
+
```
|
47
|
+
|
39
48
|
### 試したこと
|
40
49
|
|
41
50
|
ここに問題に対して試したことを記載してください。
|
42
51
|
|
43
52
|
### 補足情報(FW/ツールのバージョンなど)
|
44
|
-
|
53
|
+

|
45
54
|
ここにより詳細な情報を記載してください。
|