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.8.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

smartpredict-0.7.8-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file smartpredict-0.7.8.tar.gz.

File metadata

  • Download URL: smartpredict-0.7.8.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for smartpredict-0.7.8.tar.gz
Algorithm Hash digest
SHA256 aaa6ee580010840b63d7f5bc2f7922bbdbba72c7a047cbfc82abc32af691c3b7
MD5 540050d3861217a2d70cc990c6bb23e1
BLAKE2b-256 1ef8521aeddae43de326a77fec7a90b19fb3906964296d84ce22bbc79f83218c

See more details on using hashes here.

File details

Details for the file smartpredict-0.7.8-py3-none-any.whl.

File metadata

  • Download URL: smartpredict-0.7.8-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for smartpredict-0.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 04c57f44ced3fd0983e9d63945cb3d7c01fe7713980e207bcb3f446f24059177
MD5 a4d94ca57796ba1afa3021168332314e
BLAKE2b-256 632c48531a959c954e29deecc226d7f62517184c05964d13cb9beb21d00087e9

See more details on using hashes here.

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