これは、「scikit-learnで始める機械学習 チュートリアル」のテストコードです。
git clone https://gist.github.com/8bd959a3d71bf6ff6487bc8885f5c9de.git
cd 8bd959a3d71bf6ff6487bc8885f5c9de
python main.py| import numpy as np | |
| from sklearn import svm | |
| trailFeature = np.genfromtxt(open('train.csv', 'r'), delimiter = ',') | |
| trailLabel = np.genfromtxt(open('trainLabels.csv', 'r'), delimiter = ',') | |
| clf = svm.SVC(kernel='rbf', C=1) | |
| clf.fit(trailFeature, trailLabel) | |
| testFeature = np.genfromtxt(open('train_test.csv', 'r'), delimiter = ',') | |
| result = clf.predict(testFeature) | |
| print(result) |
| 0.2994 | -1.2266 | |
|---|---|---|
| -11.1741 | 0.3321 |
| 0.2994 | -1.2266 | |
|---|---|---|
| -11.1741 | 0.3321 |
| 1 | |
| 0 |