Discussion of article "Data Science and Machine Learning (Part 09) : The K-Nearest Neighbors Algorithm (KNN)"
Greetings!
Sorry if I'm wrong with my assumption, but I think, that
I think it should remove vector element with specific index, but it removes nothing, because nothing happens with original vector and function returns nothing.
Am I wrong?
Sorry if I'm wrong with my assumption, but I think, that
void CKNNNearestNeighbors::VectorRemoveIndex(vector &v, ulong index) { vector new_v(v.Size()-1); for (ulong i=0, count = 0; i<v.Size(); i++) if (i == index) { new_v[count] = new_v[i]; count++; } }is useless. Code is taken in KNN_neareast_neighbors.mqh file.
I think it should remove vector element with specific index, but it removes nothing, because nothing happens with original vector and function returns nothing.
Am I wrong?
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
New article Data Science and Machine Learning (Part 09) : The K-Nearest Neighbors Algorithm (KNN) has been published:
This is a lazy algorithm that doesn't learn from the training dataset, it stores the dataset instead and acts immediately when it's given a new sample. As simple as it is, it is used in a variety of real-world applications
Few Things to Note:
Author: Omega J Msigwa