Skip to content

msikorski93/Logistic-Regression-Classifier-From-Scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Logistic-Regression-Classifier-From-Scratch

 alt text  alt text  alt text  alt text  alt text

Logistic regression with the ability of implementing penalty terms. The class object is dedicated to binary classification and is compatible with scikit-learn's GridSearchCV method.
An example of its usage was performed on the WBCD dataset and returned the following estimates:

  • Accuracy: 0.9883
  • Recall: 0.9841
  • Precision: 0.9841
  • Error Rate: 0.0117
  • F1 Score: 0.9841
  • ROC: 0.9874
  • Specificity: 0.9907
  • Misclassified Samples: 2 (out of 171)

Code example:

from logistic_regression import LogisticRegression

log_model = LogisticRegression(learning_rate=0.01, C=0.1, num_iter=20, penalty='elasticnet', l1_ratio=0.7)
log_model.fit(X_train, y_train)

predictions = log_model.predict(X_test, threshold=0.6)

About

Logistic regression created in Python for binary classification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published