TransWikia.com

How do you visualize Decision boundaries?

Data Science Asked on July 20, 2021

My features for a problem are just a single feature, so X_train has just a single dimension. Now, I have used SVM , naive Bayes, and Logistic Regression. So now How do I draw the decision boundaries of these classifiers? Is there is a way to draw a one dimension feature vector with the decision boundary using python? I have done many searches but I couldn’t find any results. The X_train shape is (489, 1) (489 instances each with a single value)

One Answer

To visualize a decision boundary of a classifier, specifically a binary classifier as in your case, you can instantiate a grid of points that spans the domain of interest that you want to classify. Then use your trained classifier to predict the class of each and every point in the grid. If the grid resolution is fine enough, when you plot the contours of the grid points with color corresponding to its class, you can then visualize the decision boundary. It is helpful to overlay the original training data points so that you can see how your decision boundaries are generated based on various training sets. See the following exampleenter image description here

Answered by ARandomName on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP