Attempting to draw decision boundary in logistic classification.

3 views (last 30 days)
Hi all
I have a data set with weight and sex of teenage children in the UK and am using it to learn how to perform a logistic classification in Matlab. I am attempting to draw my decision boundary using this one-feature script, but I am getting something that makes no sense and I cannot for the life of me figure it out.
My problem is very specific - I am using only one feature (weight) to classify sex. I'm to understand the theta vector I get will give the equation of a point where I can draw a decision boundary. My values of theta make my decision boundary ridiculous. For starters, it isn't in an appropriate range at all, and second, it's negative. My thetas values will not allow for a positive decision boundary. Can anyone help me find where I've gone wrong?
  2 Comments
Sahil Jain
Sahil Jain on 18 Oct 2021
A negative decision boundary in this case would mean that your model classifies every observation with the same label. Is your data imbalanced by any chance? I would also urge you to check your code once. Does it work well with a different dataset (Iris perhaps)?
Jarrad Perron
Jarrad Perron on 18 Oct 2021
Sahil
Your were correct - there was a logical error that was classifying everything as the same. I have since fixed it. Thank you muchly.
Jarrad

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!