按照标杆的格式重新写了下
之前上传的结果达到0.99
供大家讨论
# -*- coding: utf-8 -*-
from sklearn.neighbors import KNeighborsClassifier
import pandas as pd
import numpy as np
train = pd.read_csv('train.csv')
test = pd.read_csv('test.csv')
train.drop('id', axis=1, inplace=True)
test.drop('id', axis=1, inplace=True)
train_labels = train.pop('y')
clf = KNeighborsClassifier()
clf.fit(train, train_labels)
submit = pd.read_csv('sample_submit.csv')
submit['y'] = clf.predict(test)
submit.to_csv('knn', index=False)
2个回答
Random Forest 比 KNN 还要强!SVC (rbf核)也跟 KNN 差不多。
我想出题者也没有想过,这条题目原来那么简单。现在游戏已经变成:你能否全对。