Danish Khan
Danish Khan

Reputation: 1544

Can linear classification take non binary targets?

I'm following a TensorFlow example that takes a bunch of features (real estate related) and "expensive" (ie house price) as the binary target.

I was wondering if the target could take more than just a 0 or 1. Let's say, 0 (not expensive), 1 (expensive), 3 (very expensive).

I don't think this is possible as the logistic regression model has asymptotes nearing 0 and 1.

This might be a stupid question, but I'm totally new to ML.

Upvotes: 1

Views: 1325

Answers (2)

Upul Bandara
Upul Bandara

Reputation: 5958

Logistic Regression is defined for binary classification tasks.(For more details, please logistic_regression. For multi-class classification problems, you can use Softmax Classification algorithm. Following tutorials shows how to write a Softmax Classifier in Tensorflow Library.

Softmax_Regression in Tensorflow

However, your data set is linearly non-separable (most of the time this is the case in real-world datasets) you have to use an algorithm which can handle nonlinear decision boundaries. Algorithm such as Neural Network or SVM with Kernels would be a good choice. Following IPython notebook shows how to create a simple Neural Network in Tensorflow.

Neural Network in Tensorflow

Good Luck!

Upvotes: 0

Danish Khan
Danish Khan

Reputation: 1544

I think I found the answer myself. From Wikipedia:

First, the conditional distribution y|x is a Bernoulli distribution rather than a Gaussian distribution, because the dependent variable is binary. Second, the predicted values are probabilities and are therefore restricted to (0,1) through the logistic distribution function because logistic regression predicts the probability of particular outcomes.

Upvotes: 1

Related Questions