# What are the inputs to a logistic regression? Probability or trial result?

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?

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

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.

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.