Skip to main content
4 of 4
added 1 character in body
Luka
  • 135
  • 4

Classify vs LogitModelFit

Can someone explain me what is the difference between Classify[trainingset, Method -> "LogisticRegression"] function and LogitModelFit[trainingset, x, x] function in Wolfram Mathematica.

For example:

trainingset = {1 -> "A", 2 -> "A", 3.5 -> "B", 4 -> "B"};
c = Classify[trainingset, Method -> "LogisticRegression"];

c[2.6, "Probabilities"]
<|"A" -> 0.979033, "B" -> 0.0209672|>

But:

trainingset1  = {{1, 0}, {2, 0}, {3.5, 1}, {4, 1}};
c1 = LogitModelFit[trainingset1  , x, x] // Normal;

c1 /. {x -> 2.6}
0.0178003

Obviously, probabilities are not exactly the same. I also tried with ProbitModelFit, but again, probabilities are different.

Why is this the case?

Luka
  • 135
  • 4