Where can I find practical example of KNN in java using weka

后端 未结 2 742
悲&欢浪女
悲&欢浪女 2021-01-24 11:52

I have been searching for a practical example of KNN implementation using weka, but all I find is too general for me to understand the data that it needs to be able to work (or

2条回答
  •  情歌与酒
    2021-01-24 12:37

    Its Fairly Simple. In order to understand why is it always /(69-35) and also /(150000-38000), You first need to understand what Normalization means.

    Normalization:
    Normalization usually means to scale a variable to have a values between 0 and 1.
    The formula is as follows:

    If you closely look at the denominator of the above formula, you will observe that it's the max value of all the number subtracted from the min value of all the number.

    Now, Get back to you question... Look at the 5th line of the Question. Its says as follow.

    The easiest and most common distance calculation is the "Normalized Euclidian Distance."

    In you Age column, you can see that the min value is 35 and the max value is 69.Similarly, in your Income column you min value is 38k and max would be 150k.

    This is the exact reason that you always have it /(69-35) and also /(150000-38000).

    Hope you have understood it.

    PEACE

提交回复
热议问题