Skip to main content

ModelSelector automates ensemble creation, added AutoTuner.

Project description

ModelSelector

The ModelSelector class is a comprehensive tool designed to simplify the model selection process in machine learning. It automates the creation of an ensemble pipeline containing a selected number of models, optimizing hyperparameters for optimal prediction scores.

Input Parameters

When initializing the ModelSelector class, you can provide the following input parameters:

  • data (pandas DataFrame): The input dataset to be used for model selection.

  • target (str): The name of the target column in the dataset.

  • eda_pipe (sklearn Pipeline, optional): An optional pipeline for Exploratory Data Analysis (EDA). If provided, EDA will be performed on the dataset before model selection. Defaults to None.

  • task (str, optional): The task to be performed, which can be either 'classification' or 'regression'. Defaults to 'classification'.

  • i (int, optional): The number of best models to be selected. You can specify the number of top-performing models to include in the final ensemble. The maximum value is 6. Be aware that selecting more models increases the computation time. Defaults to 2.

  • precision (float, optional): A precision value ranging from 0.1 to 1. A higher precision value results in more precise model selection but requires more time to run. It determines the granularity of model evaluation. Defaults to 0.2.

Getting the Final Pipeline

After initializing the ModelSelector class with your desired parameters, you can obtain the final machine learning pipeline by calling the get_pipeline() method. This pipeline will consist of the selected ensemble of models, fine-tuned with the best hyperparameters.

Here's an example of how to use the ModelSelector class:

# Import the ModelSelector class
from model_selector import ModelSelector

# Initialize the ModelSelector with your data and target column
selector = ModelSelector(data=my_data, target='target_column')

# Get the final machine learning pipeline
final_pipeline = selector.get_pipeline()

## Features

- **Automated Ensemble Creation:** The `ModelSelector` class automatically generates an ensemble pipeline with a specified number of models, each contributing to the final predictions.
- **Hyperparameter Optimization:** Utilizes a combination of model selection and hyperparameter tuning to output the best-performing models and their corresponding hyperparameters.
- **Versatile Usage:** Offers both automatic ensemble creation (`start()`) and the option to fine-tune an existing pipeline with a specific model (`auto_tuning()`).
- **Scoring:** Run the (`evaluate()`) function after ensemble creation to get your scores.
- **Supports Classification and Regression:** Adaptable for both classification and regression tasks, providing flexibility in application.
- **Easy Retrieval of Best Pipeline:** Use the `get_pipeline()` function to retrieve the optimized pipeline with the best-performing models.

## Installation

You can install the `ModelSelector` class using pip:

```bash
pip install yctmodel

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yctmodel-5.2.17.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yctmodel-5.2.17-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file yctmodel-5.2.17.tar.gz.

File metadata

  • Download URL: yctmodel-5.2.17.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for yctmodel-5.2.17.tar.gz
Algorithm Hash digest
SHA256 dc1287c2f6feeb2c63d414764f9e98025f767d358c60b1d3e93aa01121c68b1d
MD5 13cfdd05612531088dd83350345d3370
BLAKE2b-256 2d5a6966ef2e900f6b31d27a2d71187df117dc400bb7a659a5e2c00b70a491c2

See more details on using hashes here.

File details

Details for the file yctmodel-5.2.17-py3-none-any.whl.

File metadata

  • Download URL: yctmodel-5.2.17-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for yctmodel-5.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 69d6611cc7c4c0d4e9ade51ba084842b1e0b5fa16bdee37c1e74cc2f9136b7d3
MD5 84505ee92a1f02f807fd9028957d836c
BLAKE2b-256 c4f00cb143edc6fc96daeeabc26c5e61ebf7430122a7eac1d62d9ef6a3aef31d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page