Attempting to draw decision boundary in logistic classification.

3 vues (au cours des 30 derniers jours)
Jarrad Perron
Jarrad Perron le 5 Oct 2021
Commenté : Jarrad Perron le 18 Oct 2021
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 commentaires
Sahil Jain
Sahil Jain le 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 le 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

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by