The fitted_value column gives the probability that a student belongs to one of the output classes. A typical logistic regression graph is displayed, as shown in the following figure, mapping the input x-axis against a y probability value between [0,1].
The fitted_value probability of > = 0.5 implies class 1 (student admitted) and a probability of < 0.5 implies class 0 (student rejected).
The following query returns the following table:
ALTER table glmpredict_admissions ADD column fitted_category int; UPDATE glmpredict_admissions SET fitted_category = 1 WHERE fitted_value > 0.4999; UPDATE glmpredict_admissions SET fitted_category = 0 WHERE fitted_value < 0.4999; SELECT * FROM glmpredict_admissions ORDER BY 1;
id | masters | gpa | stats | programming | admitted | fitted_value | fitted_category |
---|---|---|---|---|---|---|---|
50 | yes | 3.95 | Beginner | Beginner | 0 | 0.35076568493861 | 0 |
51 | yes | 3.76 | Beginner | Beginner | 0 | 0.355711270634992 | 0 |
52 | no | 3.7 | Novice | Beginner | 1 | 0.758307972010008 | 1 |
53 | yes | 3.5 | Beginner | Novice | 1 | 0.556015248287644 | 1 |
54 | yes | 3.5 | Beginner | Advanced | 1 | 0.769476126790063 | 1 |
55 | no | 3.6 | Beginner | Advanced | 1 | 0.968031451283364 | 1 |
56 | no | 3.82 | Advanced | Advanced | 1 | 0.945773239222729 | 1 |
57 | no | 3.71 | Advanced | Advanced | 1 | 0.946412421748131 | 1 |
58 | no | 3.13 | Advanced | Advanced | 1 | 0.949666663764171 | 1 |
59 | no | 3.65 | Novice | Novice | 1 | 0.874190783966478 | 1 |
60 | no | 4 | Advanced | Novice | 1 | 0.8650601595144 | 1 |
61 | yes | 4 | Advanced | Advanced | 1 | 0.650621000328301 | 1 |
62 | no | 3.7 | Advanced | Advanced | 1 | 0.946470175529378 | 1 |
63 | no | 3.83 | Advanced | Advanced | 1 | 0.945714776638306 | 1 |
64 | yes | 3.81 | Advanced | Advanced | 1 | 0.655525617391707 | 1 |
65 | yes | 3.9 | Advanced | Advanced | 1 | 0.653206427288345 | 1 |
66 | no | 3.87 | Novice | Beginner | 1 | 0.754740354720256 | 1 |
67 | yes | 3.46 | Novice | Beginner | 0 | 0.260036221097295 | 0 |
68 | no | 1.87 | Advanced | Novice | 1 | 0.890966489834395 | 1 |
69 | no | 3.96 | Advanced | Advanced | 1 | 0.94494933637213 | 1 |