krisy / kaggle

kaggle
1 stars 1 forks source link

Implementing a basic knn model with weighting functions #2

Open krisy opened 11 years ago

krisy commented 11 years ago

Implement a basic knn model with numpy:

krisy commented 11 years ago

See: http://glowingpython.blogspot.hu/2012/04/k-nearest-neighbor-search.html for an implementation of knn in numpy. For {columnname}Distance:

krisy commented 11 years ago

Also see http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.KDTree.html#scipy.spatial.KDTree for KDTree implementation in numpy

krisy commented 11 years ago

In the first 1000 rows, if the resource_id and role_id where equal for two rows, in only about 30 events were the outcomes (action) different. Need to check this, and that how many pairs were in total - but should be a nice start for knn (if there are a lot of similar elements in the test)