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 toNone. -
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
ModelSelectorclass 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 ensemble creation (
start()). - 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. - AutoTuner Class Gives the option to fine-tune an existing pipeline with a specific model (
auto_tune()), given a specific data. Takes X and Y (could be X_train and y_train).
Installation
You can install the ModelSelector class using pip:
pip install yctmodel
Metadata
Release files for yctmodel 5.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yctmodel-5.4.0.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yctmodel-5.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.8 kB
Release files / yctmodel-5.4.0.tar.gz
| Download URL | yctmodel-5.4.0.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2135ecf7911d360c14412c97d98cd63a48f01a9e1ee0cbf02ae021f9f3488a33
|
|
BLAKE2b-256 checksum How to use checksums |
63958a715680a22ee7a92cc7697084994971ee42d2ab54ff8116b953b5cbb08e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / yctmodel-5.4.0-py3-none-any.whl
| Download URL | yctmodel-5.4.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3318b594a0ffe308233d803dbfba5c7ac4e2a38368dfd4ea8d995dd619c337fe
|
|
BLAKE2b-256 checksum How to use checksums |
8a086b75df6aa0c5caa06ddbe5cd29cc8dfe56da737a4c1bf9061d7c743e56d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|