GithubHelp home page GithubHelp logo

mlpackage's Introduction

About the project

Part of the MLOps Bootcamp: Mastering AI Operations for Success - AIOps Udemy course.

https://www.udemy.com/course/mlops-bootcamp-mastering-ai-operations-for-success-aiops

Technologies used

  • Python
  • Sci-kit learn
  • Pytest
  • Pandas
  • setuptools

Packaging the ML Model of Classification

Problem Statement

  • Company wants to automate the loan eligibility process based on customer detail provided while filling online application form.
  • It is a classification problem where we have to predict whether a loan would be approved or not.

Data

The data corresponds to a set of financial requests associated with individuals.

Variables Description
Loan_ID Unique Loan ID
Gender Male/ Female
Married Applicant married (Y/N)
Dependents Number of dependents
Education Applicant Education (Graduate/ Under Graduate)
Self_Employed Self employed (Y/N)
ApplicantIncome Applicant income
CoapplicantIncome Coapplicant income
LoanAmount Loan amount in thousands
Loan_Amount_Term Term of loan in months
Credit_History credit history meets guidelines
Property_Area Urban/ Semi Urban/ Rural
Loan_Status Loan approved (Y/N)

Source: Kaggle

Directory structure

prediction_model


├── MANIFEST.in
├── prediction_model
│   ├── config
│   │   ├── config.py
│   │   └── __init__.py
│   ├── datasets
│   │   ├── __init__.py
│   │   ├── test.csv
│   │   └── train.csv
│   ├── __init__.py
│   ├── pipeline.py
│   ├── predict.py
│   ├── processing
│   │   ├── data_handling.py
│   │   ├── __init__.py
│   │   └── preprocessing.py
│   ├── trained_models
│   │   ├── classification.pkl
│   │   └── __init__.py
│   ├── training_pipeline.py
│   └── VERSION
├── README.md
├── requirements.txt
├── setup.py
└── tests
    ├── pytest.ini
    └── test_prediction.py

Build the Package

  1. Goto Project directory and install dependencies pip install -r requirements.txt

  2. Create Pickle file after training: python prediction_model/training_pipeline.py

  3. Create source distribution and wheel python setup.py sdist bdist_wheel

Installation of Package

Go to project directory where setup.py file is located

  1. To install it in editable or developer mode
pip install -e .

. refers to current directory

-e refers to --editable mode

  1. Normal installation
pip install .

. refers to current directory

  1. Also can be installed from git as well after pushing to github
pip install git+https://github.com/marcodavidg/MLPackage.git

Testing the Package Working

  1. Remove the PYTHONPATH from environment variables
  2. Go to a separate location which is outside of package directory
  3. Create a new virual environment & activate it
  4. Before installing, test whether you are able to import the package of prediction_model - (you should not be able to do it)
  5. Now in the new environment install the package from github pip install git+https://github.com/marcodavidg/MLPackage.git
  6. Now try importing the prediction_model, you should be able to do it successfully
  7. Extras : Run training pipeline using the package, and also conduct the test

mlpackage's People

Contributors

marcodavidg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.