-
Notifications
You must be signed in to change notification settings - Fork 2.2k
分配任务 #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
分配任务 #54
Changes from 1 commit
5657862
f49f11a
2a3ca68
ed2c1f6
ecf376d
8d97d9d
cf37b20
64d55c5
22e47a5
eb3b091
f56d316
f18382f
1dd4a18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,17 +34,29 @@ def saveResult(result, csvName): | |
| myWriter.writerow(["ImageId", "Label"]) # 设置表格的列名 | ||
| index = 0 | ||
| for i in result: | ||
| <<<<<<< HEAD:src/python/getting-started/digit-recognizer/dr_knn_pandas-3.6.py | ||
| tmp = [] # 列表,列表是可以改变长度的 | ||
| index = index+1 | ||
| tmp.append(index) # ImageId的数值 | ||
| ======= | ||
|
||
| tmp = [] | ||
| index = index + 1 | ||
| tmp.append(index) | ||
| >>>>>>> c557666d2213e02de23677bf53692e9ecf20b456:src/python/getting-started/digit-recognizer/knn-python3.6.py | ||
| # tmp.append(i) | ||
| tmp.append(int(i)) # 测试集的标签值 | ||
| myWriter.writerow(tmp) | ||
|
|
||
|
|
||
| def knnClassify(trainData, trainLabel): | ||
| <<<<<<< HEAD:src/python/getting-started/digit-recognizer/dr_knn_pandas-3.6.py | ||
|
||
| knnClf = KNeighborsClassifier() # default:k = 5,defined by yourself:KNeighborsClassifier(n_neighbors=10) | ||
| knnClf.fit(trainData, ravel(trainLabel))# ravel Return a contiguous flattened array. | ||
| ======= | ||
| knnClf = KNeighborsClassifier( | ||
| ) # default:k = 5,defined by yourself:KNeighborsClassifier(n_neighbors=10) | ||
| knnClf.fit(trainData, ravel(trainLabel)) # ravel | ||
| >>>>>>> c557666d2213e02de23677bf53692e9ecf20b456:src/python/getting-started/digit-recognizer/knn-python3.6.py | ||
| return knnClf | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,7 +215,11 @@ def preDRSVM(): | |
| if __name__ == '__main__': | ||
| trainData, trainLabel, preData = opencsv() | ||
| # 训练并保存模型 | ||
| <<<<<<< HEAD:src/python/getting-started/digit-recognizer/dr-python-3.6.py | ||
|
||
| #trainDRSVM() | ||
| ======= | ||
| trainDRSVM() | ||
| >>>>>>> c557666d2213e02de23677bf53692e9ecf20b456:src/python/getting-started/digit-recognizer/svm-python3.6.py | ||
|
|
||
| # 分析数据 | ||
| analyse_data(trainData) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有几个地方有冲突,这个需要你先拉取一下,然后再处理