This repository hosts a simple Logistic Regression model trained on a synthetic dataset for binary classification. The model is built using scikit-learn and saved using joblib.
To load and use this model, you can follow these steps in your Python environment:
1from huggingface_hub import hf_hub_download
2import joblib
3import numpy as np
4
5# Define the repository ID and the model file path
6repo_id = "farooqhasanDA/logistic_regression_model-sklearn-model" # Replace with your actual repo_id
7filename = "models/logistic_regression_model.joblib"
8
9# Download the model file
10model_path = hf_hub_download(repo_id=repo_id, filename=filename)
11
12# Load the model
13loaded_model = joblib.load(model_path)
14
15# Example usage: Make a prediction
16# Create a dummy input similar to the training data (e.g., 4 features)
17dummy_input = np.array([[0.5, -0.2, 1.1, -0.7]])
18
19prediction = loaded_model.predict(dummy_input)
20prediction_proba = loaded_model.predict_proba(dummy_input)
21
22print(f"Prediction: {prediction[0]}")
23print(f"Prediction Probabilities: {prediction_proba[0]}")
This project is licensed under the Apache License 2.0. See the
LICENSE file for details.