Path: blob/master/lessons/lesson_07/code/solution-code/solution-code-7.ipynb
1904 views
Kernel: Python 3
In [1]:
In [2]:
In [3]:
Out[3]:
File "<ipython-input-3-09d36c810018>", line 7
print irisdf.plot('petal length (cm)', 'petal width (cm)', kind='scatter', c=irisdf.ctarget)
^
SyntaxError: invalid syntax
In [ ]:
More specific solution
For the class, this solution is as simple it really needs to be in order to get a very good prediction score. But: Why, or when, does this fail? What attributes make this a great data set for learning classification algorithms? What makes it not as great?
In [ ]:
Using distance: KNN implementation
In [ ]:
Do we see a change in performaance with using the distance weight?
In [ ]:
Solution to solving K
This is only one approach to the problem, but adding in the 'distance' parameter (instead of uniform) would only be additive; note that the code would need some editing to handle it properly if done in the grid search; alternatively, make the change directly in the estimator.
In [ ]:
In [ ]:
Zoom in to look at fit before first dive around 25:
In [ ]:
In [ ]: