https://github.com/arizdn234/load_dumped_model-in-python
Demonstrates the process of saving and loading machine learning models using both pickle and joblib in Python.
https://github.com/arizdn234/load_dumped_model-in-python
joblib machine-learning models pickle
Last synced: 3 months ago
JSON representation
Demonstrates the process of saving and loading machine learning models using both pickle and joblib in Python.
- Host: GitHub
- URL: https://github.com/arizdn234/load_dumped_model-in-python
- Owner: arizdn234
- Created: 2023-12-13T06:22:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-13T06:37:14.000Z (almost 2 years ago)
- Last Synced: 2024-12-30T09:15:53.840Z (9 months ago)
- Topics: joblib, machine-learning, models, pickle
- Language: Jupyter Notebook
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Model Deployment using Pickle and Joblib
### Overview
This repository demonstrates the process of saving and loading machine learning models using both `pickle` and `joblib` in Python. The example uses a logistic regression model trained on the Iris dataset.
### Contents
- **`model_training.py`**: Python script for training a logistic regression model on the Iris dataset and saving it using both `pickle` and `joblib`.
- **`model_evaluation.py`**: Python script for loading the saved models and making predictions on new data.
- **`requirements.txt`**: File containing the required Python libraries and their versions.
### Instructions
1. **Clone the Repository:**
```bash
git clone
cd
```2. **Install Dependencies:**
```bash
pip install -r requirements.txt
```3. **Train and Save the Model:**
```bash
python model_training.py
```4. **Evaluate the Model:**
```bash
python model_evaluation.py
```### Project Structure
- **`model.pkl`**: Pickle file containing the trained logistic regression model.
- **`model.joblib`**: Joblib file containing the trained logistic regression model.
### Notes
- The `model_training.ipynb` script trains a logistic regression model on the Iris dataset, evaluates its accuracy, and saves it using both `pickle` and `joblib`.
- The `model_evaluation.py` script loads the saved models and makes predictions on new data.
- The `requirements.txt` file specifies the required Python libraries and their versions.
### References
- [scikit-learn Documentation](https://scikit-learn.org/stable/documentation.html)
- [Pickle Documentation](https://docs.python.org/3/library/pickle.html)
- [Joblib Documentation](https://joblib.readthedocs.io/en/latest/)Feel free to customize this structure and documentation to fit your specific needs.