jakevdp / sklearn_pydata2015

Scikit-Learn Tutorial for PyData Seattle 2015
BSD 3-Clause "New" or "Revised" License
136 stars 113 forks source link

Feedback on Notebooks #4

Open rbhambriiit opened 5 years ago

rbhambriiit commented 5 years ago

plot_svc_decision_function does not seem to be working

image

I am trying to follow along the notebook on

Supervised Learning In-Depth: Support Vector Machines

rbhambriiit commented 5 years ago

ValueError: Expected 2D array, got 1D array instead: array=[-0.75417405 -0.43660962]. Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

rbhambriiit commented 5 years ago

Works fine after modification:


            my_array = np.array([xi, yj])
            my_array = my_array.reshape(1, -1)
#             print(my_array)
            P[i, j] = clf.decision_function(my_array)
rbhambriiit commented 5 years ago

PS: Loved the talk https://www.youtube.com/watch?v=HC0J_SPm9co :)

rbhambriiit commented 5 years ago

There are few other observations:

Ipython 3D visualisations do not seem to work for me. I am using jupyterlab. I assume this has to do with the usage of latest jupyter packages instead of ipython.

======== import seaborn as sns; sns.set() I do not see this being really used. Even though we import it.

========