rasbt / mlxtend

A library of extension and helper modules for Python's data analysis and machine learning libraries.
https://rasbt.github.io/mlxtend/
Other
4.83k stars 855 forks source link

Highlighting Nearest vectors to the plane #903

Open mountains-high opened 2 years ago

mountains-high commented 2 years ago

Describe the workflow you want to enable

Hi there~ It will be great if we add "Highlighting Nearest support vectors to the plane".

Describe your proposed solution

Something like this: New_feature

Describe alternatives you've considered, if relevant

MLxtend has a "Highlighting Test Data Points" feature. highlighting the test data

Additional context

No. Thank you for making a great source.

rasbt commented 2 years ago

That's an interesting and nice recommendation. I would almost suggest making a separate function out of this. The reason is that the plot_decision_regions is a model agnostic method. I.e., it works with any type of classifier. For a linear SVM, we can implement this more efficiently based on the decision_function. But on the other hand, there seems to be already a solution for this that doesn't require too much code, so I am not sure if it is worthwhile adding: https://scikit-learn.org/stable/auto_examples/svm/plot_linearsvc_support_vectors.html#sphx-glr-auto-examples-svm-plot-linearsvc-support-vectors-py