0
$\begingroup$

It is a very basic question, but cannot find a satisfactory answer to. When we do logistic regression, what are the inputs? Suppose we have a dataset of students giving number of hours each student spent studying, and the end result of whether they passed or failed. The wikipedia article on LR goes to do a fitting with the logistic curve based on probability as a function of number of hours. But how do I get the probabilities if all I have is whether they passed or failed?

$\endgroup$
2
  • 2
    $\begingroup$ The inputs are the independent variables and the weights assigned to it which are fed into a sigmoid function that returns probabilities. $\endgroup$
    – Kshitiz
    Jul 26, 2017 at 4:59
  • 1
    $\begingroup$ @SmallChess No I am not. Neural Networks make use of the same sigmoid function. $\endgroup$
    – Kshitiz
    Jul 26, 2017 at 8:10

2 Answers 2

1
$\begingroup$

From Wiki: The graph shows the probability of passing the exam versus the number of hours studying, with the logistic regression curve fitted to the data.

The probability curve is the output of the LR, not the input. Typically during training, the output class (or target class) will be discrete class labels with 1 or 0. During inferencing, the output will be a continuous value between 0 and 1. To generate the probability curve, just feed in different values of "hours studying" into the trained model.

$\endgroup$
0
$\begingroup$

I think this is your question:

Q1: What to give to logistic regression?

and

Q2: I just want to predict whether a student pass or not, I don't care about anything else?

Q1:

Logistic regression is able to handle categorical and continuous variables. In your example, number of hours for each student in your training set is your inputs. Of course, you'll also need a binary response variable (pass or failed).

Q2:

Logistic regression is not a classifier, the model gives you fitted probabilities conditional to the number of hours. You can set a threshold to your model (many posts exist, please search). Or you can apply a classifier such as linear discriminant analysis and many others.

$\endgroup$

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.