GithubHelp home page GithubHelp logo

rss_packaging_and_dependency_management's Introduction

Evaluation-selection

Homework for RS School Machine Learning course.

This work uses Forest Cover Type Prediction dataset.

Usage

This package allows you to train model to predict the forest cover type (the predominant kind of tree cover) from strictly cartographic variables.

  1. Clone this repository to your machine.
  2. Download Forest Cover Type Prediction dataset, save csv locally (default path is data/train.csv in repository's root).
  3. Make sure Python 3.8 and Poetry are installed on your machine (I use Poetry 1.1.13).
  4. Install the project dependencies (run this and following commands in a terminal, from the root of a cloned repository):
poetry install --no-dev
  1. Run train with the following command:
poetry run train -d <path to csv with data> -s <path to save trained model>

Additional options:

Command Type Description
-d, --dataset-path FILE [default: data/train.csv]
-s, --save-model-path FILE [default: data/model.joblib]
--random-state INTEGER [default: 42]
--clf-type TEXT [default: ExtraTreesClassifier]
--use-scaler BOOLEAN [default: True]
-f, --use-feat-engineering BOOLEAN [default: False]
-param, --model-param TEXT Model parameters set in the form of a dict like: -param "'n_estimators': 5, 'max_depth': 10"
--help Show full list of options in CLI.

You can configure additional options (such as hyperparameters) in the CLI. To get a full list of them, use help:

poetry run train --help
  1. Run MLflow UI to see the information about experiments you conducted:
poetry run mlflow ui

You can see the results of your experiments in the MLFlow UI. For example, my experimental results obtained during the execution of the work: MLFlow results

  1. Run EDA with the following command:
poetry run eda -d <path to csv with data> -s <path to save pandas-profiling file>

You can check options in the CLI. To get a full list of them, use help:

poetry run eda --help
  1. Run hyperparameter tuning with the following command:
poetry run tuning -d <path to csv with data> -s <path to save trained model>

Additional options:

Command Type Description
-d, --dataset-path FILE [default: data/train.csv]
-s, --save-model-path FILE [default: data/model.joblib]
--random-state INTEGER [default: 42]
--clf-type TEXT [default: ExtraTreesClassifier]
--use-scaler BOOLEAN [default: True]
-f, --use-feat-engineering BOOLEAN [default: False]
--help Show full list of options in CLI.

You can change default grid search parameters in ml_forest\grid_param_config.ini

  1. Run MLflow UI to see the information about experiments you conducted:
poetry run mlflow ui

Development

The code in this repository can be tested before being commited to the repository.

Install all requirements (including dev requirements) to poetry environment:

poetry install

Now you can use developer instruments, e.g. pytest:

poetry run pytest

Format your code with black by using poetry:

poetry run black ml_forest tests

Format your code with flake8 by using poetry:

poetry run flake8 ml_forest tests

rss_packaging_and_dependency_management's People

Contributors

sekai-no-uragawa 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.