Skip to main content

Help you train and optimize many popular classifiers in one place with a summary table

Project description

classifierpromax

drawing

Documentation StatusPython 3.12 ci-cd codecov

classifierpromax is a scikit-learn wrapper library that helps to train and optimize multiple classifier models in parallel.

ClassifierTrainer(): Train multiple machine learning classifiers using cross-validation and return trained models and evaluation metrics.

FeatureSelector(): Selects features for multiple classification models using RFE or Pearson methods.

ClassifierOptimizer(): Optimizes a dictionary of scikit-learn Pipeline classifiers using RandomizedSearchCV and evaluates their performance.

ResultsHandler(): Processes and combines scoring results from model training and optimization.

In a machine learning pipeline, code can often be repeated when working with multiple models, violating the DRY (Don’t-Repeat-Yourself) principle. This Python library is to promote DRY principles in machine learning code and create cleaner code.

Installation

Before installation, please make sure Python 3.12 or newer is installed.

$ pip install classifierpromax

Usage

  1. Training baseline models
import pandas as pd
import numpy as np
from classifierpromax.ClassifierTrainer import ClassifierTrainer
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler

# Dummy data
X = pd.DataFrame(np.random.rand(100, 5), columns=[f"feature_{i}" for i in range(5)])
y = pd.Series(np.random.randint(0, 2, size=100))

preprocessor = StandardScaler()
baseline_models, baseline_score = ClassifierTrainer(preprocessor, X, y, seed=123)
  1. Feature selection
from classifierpromax.FeatureSelector import FeatureSelector

fs_models = FeatureSelector(preprocessor, baseline_models, X, y, n_features_to_select=3)
  1. Hyperparameter optimization
from classifierpromax.ClassifierOptimizer import ClassifierOptimizer

opt_models, opt_score = ClassifierOptimizer(fs_models, X, y, scoring="f1")
  1. Results summary
from classifierpromax.ResultHandler import ResultHandler

summary = ResultHandler(baseline_score, opt_score)
print(summary)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

Contributors

Long Nguyen, Jenson Chang, Gunisha Kaur, Han Wang

License

classifierpromax was created by Long Nguyen, Jenson Chang, Gunisha Kaur, Han Wang. It is licensed under the terms of the MIT license.

Credits

classifierpromax was created with cookiecutter and the py-pkgs-cookiecutter template.

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

classifierpromax-1.2.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

classifierpromax-1.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file classifierpromax-1.2.1.tar.gz.

File metadata

  • Download URL: classifierpromax-1.2.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for classifierpromax-1.2.1.tar.gz
Algorithm Hash digest
SHA256 b20a5fb4e8e88c5ffea7791644a80808ed9be939c226f4f0ae7d5f489d40ee4f
MD5 300d0d55820b384b98ab6c09fe1886e4
BLAKE2b-256 600be7d17810f0350a7639da1c5388f72fa9503be597ca5e4183c84b64075d88

See more details on using hashes here.

File details

Details for the file classifierpromax-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for classifierpromax-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 970cbc22f561515172d73f10cda0514f273222714a0cf24885a26cca81d8a0bb
MD5 ef93a460a2b28bc4232275a7071df185
BLAKE2b-256 e905d6ab9cf30a4dd6009dd6ec8fa900ebb1e6372c22710555cd99ae1f00fac4

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