Skip to content

Demonstrates the process of saving and loading machine learning models using both pickle and joblib in Python.

Notifications You must be signed in to change notification settings

arizdn234/load_dumped_model-in-Python

Repository files navigation

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:

    git clone <repository-url>
    cd <repository-directory>
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Train and Save the Model:

    python model_training.py
  4. Evaluate the Model:

    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

Feel free to customize this structure and documentation to fit your specific needs.

About

Demonstrates the process of saving and loading machine learning models using both pickle and joblib in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published