I have a set of 20 observations, the target variable which is a binary variable (0 or 1), in this set has one unique value which is 1.

I want to predict this variable for a large sample, so I want to use a regression algorithm. The problem is that the target variable take one value, there is no observation that can describe the 0 class.

Is there any solution to handle this situation.

Thank you in advance.

  • 1
    $\begingroup$ If you have two outputs, your task is classification. If it is the case you can see anomoly detection approaches. $\endgroup$ – Media Apr 16 '18 at 7:20
  • $\begingroup$ I am working on forest isolation algorithm and I wanted to check if i can apply a logistic regression on this sample. $\endgroup$ – kh.b Apr 16 '18 at 9:04

Welcome to the site! As Media has mentioned it is a classification problem not prediction problem. If you meant Logistic Regression then it makes sense.

You need to remember one thing if the outcome is only one value then algorithm would also return the same value irrespective of anything. if you don't have negative cases then you cannot use Logistic regression and it doesn't know when to say 0 as the model wasn't trained on it.

If possible using Business Matter Experts advice populate some dummy data for 0's and balance the data. Train your model and see what the model is going to say.

Else you cannot use any kind of classification algorithm.

  • $\begingroup$ yeah, I meant logistic regression. For the classification, I think I don't need this set for the use of anomaly detection approach. I am working on the isolation forest algorithm, I thought I can do something with logistic regression and have some specific results using this sample. $\endgroup$ – kh.b Apr 16 '18 at 9:03
  • $\begingroup$ Using Logistic Regression/Random Forest you cannot $\endgroup$ – Toros91 Apr 16 '18 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.