python to implement perceptron learning algorithm #project: linear separatable Perceptron-learing-algorithm
#python version: 3.7.3
#OS: windows10
#author: Yangzhao Qin
#file type Both ".py".
#instructions: I wrote two programs in this hw1 file.You may use Anaconda or command board to run this two program. One is "dataemit.py",which is used to generate training data.You should open this program first. Ooen it then you have to input the "the number of '+'" and "the number of '-'" which are the "m" and "n" in the homework requests. Then you should give the vector named "w" after the "w=" in the format of "[w0,w1,w2]". Then this program will generate a text file called "train.txt" as the professor asked. The second one called "PLA.py" will utilize the data in "train.txt" and then get the trained weight "w". If you run it,it will generate a picture called "pla.png",which depicts the scatter marks and the perceptron line, and a text file called "PLAtrain.txt" contains the weight we learned.
#notice: 1.Please enter some value in "dataemit.py" input process,otherwise there will be errors. 2.Enter "w" in the format of "[w0,w1,w2]". 3.Run programs in the order of "'dataemit.py'-->'PLA.py'".