RE: trying to improve my knn algorithm

2020-07-02 Thread Raine Pretorius
] Original message From: Peter Otten <__pete...@web.de> Date: 2020/07/02 11:09 (GMT+02:00) To: python-list@python.org Subject: Re: trying to improve my knn algorithm kyroha...@gmail.com wrote: > This is another account but I am the op. Why do you mean normalize? Sorry > I’m

Re: trying to improve my knn algorithm

2020-07-02 Thread Peter Otten
kyroha...@gmail.com wrote: > This is another account but I am the op. Why do you mean normalize? Sorry > I’m new at this. Take three texts containing the words covid, vaccine, program, python Some preparatory imports because I'm using numpy: >>> from numpy import array >>> from numpy.linalg im

Re: trying to improve my knn algorithm

2020-07-01 Thread kyrohammy
This is another account but I am the op. Why do you mean normalize? Sorry I’m new at this. -- https://mail.python.org/mailman/listinfo/python-list

Re: trying to improve my knn algorithm

2020-07-01 Thread Peter Otten
hunter.hammond@gmail.com wrote: > This is a knn algorithm for articles that I have gotten. Then determines > which category it belongs to. I am not getting very good results :/ [snip too much code;)] - Shouldn't the word frequency vectors be normalized? I don't see that in your code. Witho

trying to improve my knn algorithm

2020-07-01 Thread hunter . hammond . dev
This is a knn algorithm for articles that I have gotten. Then determines which category it belongs to. I am not getting very good results :/ k = 23 training_folder = './data/training/' minn_folder = training_folder + 'Minnesota/' health_folder = training_folder + 'Health/' def remove_punctuatio