LR CVD
LR CVD
py', wdir='C:/Users/TECB-
M114/.spyder-py3')
Total number of rows with missing values is 2
since it is only 1 percent of the entire dataset the rows with missing values are excluded.
1
2
Optimization terminated successfully.
Current function value: 0.405550
Iterations 7
CI 95%(2.5%) CI 95%(97.5%) Odds Ratio pvalue
const 0.000567 0.025715 0.003817 0.000
cp 1.179412 2.941215 1.862500 0.008
restecg 1.016679 2.403018 1.563041 0.042
ca 1.532832 4.402983 2.597890 0.000
thal 1.277471 1.983525 1.591822 0.000
C:\Users\TECB-M114\Anaconda3\lib\site-packages\sklearn\linear_model\logistic.py:432:
FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to
silence this warning.
FutureWarning)
The acuuracy of the model = TP+TN/(TP+TN+FP+FN) = 0.7419354838709677
The Missclassification = 1-Accuracy = 0.25806451612903225
Sensitivity or True Positive Rate = TP/(TP+FN) = 0.625
Specificity or True Negative Rate = TN/(TN+FP) = 0.8666666666666667
Positive Predictive value = TP/(TP+FP) = 0.8333333333333334
Negative predictive Value = TN/(TN+FN) = 0.6842105263157895
Positive Likelihood Ratio = Sensitivity/(1-Specificity) = 4.687500000000001
Negative likelihood Ratio = (1-Sensitivity)/Specificity = 0.43269230769230765
With 0.1 threshold the Confusion Matrix is
[[ 6 9]
[ 4 12]]
with 18 correct predictions and 4 Type II errors( False Negatives)
3
With 0.4 threshold the Confusion Matrix is
[[13 2]
[ 6 10]]
with 23 correct predictions and 6 Type II errors( False Negatives)
4
5
6
In [5]: