This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
from pprint import pprint | |
import numpy as np | |
import pandas as pd | |
from sklearn.neighbors import KNeighborsClassifier | |
#References - http://saravananthirumuruganathan.wordpress.com/2010/05/17/a-detailed-introduction-to-k-nearest-neighbor-knn-algorithm/ | |
#http://www.saedsayad.com/k_nearest_neighbors.htm | |
input = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random, pdb | |
from pprint import pprint | |
import pandas as pd, numpy as np | |
import sklearn | |
from sklearn.cluster import KMeans | |
labels = {0 : 'apple', 1 : 'banana'} | |
input = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import numpy as np | |
import math, pdb | |
from sklearn import linear_model | |
#http://stackoverflow.com/questions/17784587/gradient-descent-using-python-and-numpy | |
def genData(numPoints, bias, variance): |
NewerOlder