Skip to main content

An advanced machine learning library for effortless model training, evaluation, and selection.

Project description

SmartPredict

PyPI version Build Status License: MIT

SmartPredict is an advanced machine learning library designed to simplify model training, evaluation, and selection. It provides a comprehensive set of tools for classification and regression tasks, including automated hyperparameter tuning, feature engineering, ensemble methods, and model explainability.

Table of Contents

Installation

You can install SmartPredict using pip:

pip install smartpredict

Features

  • Advanced Model Selection: Supports a wide range of models, including tree-based methods, neural networks, and more.
  • Automated Hyperparameter Tuning: Uses Optuna for efficient hyperparameter optimization.
  • Feature Engineering: Includes tools for automated feature creation and selection.
  • Ensemble Methods: Implements stacking, blending, and voting techniques.
  • Model Explainability: Provides SHAP and LIME for interpretability.
  • Parallel Processing: Speeds up model training and evaluation.

Quick Start

Here’s a quick example to get you started:

from smartpredict import SmartClassifier
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split

data = load_breast_cancer()
X = data.data
y = data.target

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.5, random_state=123)

clf = SmartClassifier(verbose=1)
results = clf.fit(X_train, X_test, y_train, y_test)
print(results)

Usage

Classification

from smartpredict import SmartClassifier

# Your code for loading and splitting data

clf = SmartClassifier(verbose=1)
results = clf.fit(X_train, X_test, y_train, y_test)
print(results)

Regression

from smartpredict import SmartRegressor

# Your code for loading and splitting data

reg = SmartRegressor(verbose=1)
results = reg.fit(X_train, X_test, y_train, y_test)
print(results)

Advanced Features

Hyperparameter Tuning

SmartPredict uses Optuna for hyperparameter optimization:

clf = SmartClassifier(hyperparameter_tuning=True)
results = clf.fit(X_train, X_test, y_train, y_test)
print(results)

Feature Engineering

Automated feature engineering to improve model performance:

from smartpredict import SmartClassifier

clf = SmartClassifier(feature_engineering=True)
results = clf.fit(X_train, X_test, y_train, y_test)
print(results)

Explainability

Model explainability with SHAP:

clf = SmartClassifier(explainability=True)
results = clf.fit(X_train, X_test, y_train, y_test)
print(results)

Ensemble Methods

Combine multiple models for better performance:

clf = SmartClassifier(ensemble_methods=True)
results = clf.fit(X_train, X_test, y_train, y_test)
print(results)

Model Assessment

SmartPredict provides comprehensive model assessment metrics to evaluate your machine learning models. Here is how you can use it:

from smartpredict import ModelAssessment

# Assuming model, X_test, and y_test are defined
assessment = ModelAssessment(model, X_test, y_test)
results = assessment.summary()

print("Model Assessment Metrics:")
print(f"Accuracy: {results['accuracy']}")
print(f"Precision: {results['precision']}")
print(f"Recall: {results['recall']}")
print(f"F1 Score: {results['f1_score']}")
print(f"Confusion Matrix: {results['confusion_matrix']}")
print(f"ROC AUC: {results['roc_auc']}")
print("Classification Report:")
print(results['classification_report'])

Contributing

We welcome contributions! Please read our Contributing Guidelines for more information.

License

SmartPredict is licensed under the MIT License. See the LICENSE file for details.

Changelog

[0.7.4] - 2024-05-24

Added

  • KernelExplainer in place of Explainer
  • Added .shape_values in place of .values

[0.6.13] - 2024-05-23

Added

  • Added comprehensive model assessment metrics to evaluate machine learning models.
    • Accuracy
    • Precision
    • Recall
    • F1 Score
    • Confusion Matrix
    • ROC AUC
    • Classification Report

[0.6.12] - 2024-05-23

Updated

  • Updated Github release.

[0.6.11] - 2024-05-23

Updated

  • Updated dependencies to latest versions:
    • scikit-learn
    • numpy
    • pandas
    • shap
    • optuna
    • xgboost
    • lightgbm
    • catboost
    • tensorflow
    • torch

[0.6.10] - 2024-05-22

Added

  • Initial release of SmartPredict.

[0.6.0] - 2024-05-01

Added

  • Core functionalities for model training, evaluation, and selection.
  • Support for scikit-learn, numpy, pandas, shap, optuna, xgboost, lightgbm, catboost, tensorflow, and torch.

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

smartpredict-0.7.6.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

smartpredict-0.7.6-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

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