Attempting to draw decision boundary in logistic classification.

3 次查看(过去 30 天)
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 个评论
Sahil Jain
Sahil Jain 2021-10-18
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 2021-10-18
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

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by