(1) Learn to reprint an article on machine learning handwritten digit recognition
Python 3 uses machine learning model for handwritten digit detection
Python 3 generates a dataset of handwritten digits
(2) Technical summary
In the initial stage of machine learning code implementation, it is necessary to start the project by yourself, but also to read more blog posts of other predecessors, especially some projects with additional algorithm ideas. Do it yourself, only in the process of code implementation can you find many problems, summarize the basic code, and spare.
Folders are automatically generated:
@author: Wang Gan """ import them path_folders = "H:/Python data/own code/handwritten number recognition/P_generate_handwritten_number/data_pngs/" # 1-9 for i in range(49,58): if (os.path.isdir(path_folders + chr(i))): pass else: # print(i,": ",path_1+chr(i)) # build directory os.mkdir(path_folders+chr(i))
Renaming of files:
# Rename CSV with "test_+samples.csv" if "data_"+str(sample_nums)+".csv" in tmpdir: # Data_XXX.csv has been generated before and needs to be deleted first os.remove(path_csv+"data_"+str(sample_nums)+".csv") os.rename(path_csv+"test1.csv", path_csv+"data_"+str(sample_nums)+".csv") else: os.rename(path_csv+"test1.csv", path_csv+"data_"+str(sample_nums)+".csv")
Sinicization path pandas open:
# read CSV data column_names = ["samples", "acc_LR", "acc_LSVC", "acc_MLPC", "acc_SGDC"] f=open('H:/Python data/own code/handwritten digit recognition/Feature_extract/data/score_csv/'+'score.csv') rd_csv = pd.read_csv( f , names=column_names)
How to call a class in one file from another file
Knowledge about python main function
The accuracy is not high enough Reason analysis: (The reason is unknown)
My own results provided by the original author
Problem solved: next blog post.