Skip to content

Demo for KNN(K-Nearest Neighbor) & Iris module(a classical test) in data analysis in Python

Notifications You must be signed in to change notification settings

Alan-D-Chen/KNN_ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KNN_ML

========================================================
Demo for KNN(K-Nearest Neighbor) & Iris module(a classical test) in data analysis in Python

This is a simple demo for KNN(K-Nearest Neighbor)


>>Python3 Pycharm

02.KNN(K-Nearest Neighbor)


If you get that :
'AttributeError: 'dict' object has no attribute 'iteritems'

you will find some help from here:
*help1


If you get that :
IndexError: list index out of range

def getAccuracy(testSet, predictions):
    correct = 0
    for x in range(len(testSet)-1):
        if testSet[x][-1] == predictions[x]:
            correct += 1
    return (correct/float(len(testSet)))*100.0

you will find some help from here:
**help2

best wish for you.

About

Demo for KNN(K-Nearest Neighbor) & Iris module(a classical test) in data analysis in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages