Skip to main content

A Python Package for Automatic Multi-Model Analysis (Classification & Regression)

Project description

Multi-Model Analysis

PyPI version License: Apache

multimodel_analysis is a comprehensive machine learning library created by Uditya Narayan Tiwari. It automates the process of training, evaluating, and visualizing multiple models for both Classification and Regression tasks.

Designed for data scientists and researchers, it streamlines model selection by providing automatic feature scaling, detailed performance metrics, and professional-grade visualizations in just a few lines of code.


📦 Installation

Install via PyPI

The easiest way to install the package is via pip:

pip install multimodel_analysis

Install from GitHub

To get the latest development version:

pip install git+[https://github.com/udityamerit/multimodel_analysis.git](https://github.com/udityamerit/Multimodel-Analysis-Pacakge.git) --upgrade --force-reinstall

📋 Requirements

  • numpy
  • pandas
  • matplotlib
  • seaborn
  • scikit-learn

How to Use

1. Classification Analysis

Use MultiModelClassifier for categorical target variables. It automatically compares models like Logistic Regression, SVM, Decision Trees, Random Forest, Gradient Boosting, and more.

Step 1: Initialize and Train

import pandas as pd
from multimodel_analysis import MultiModelClassifier

# Load your dataset
df = pd.read_csv('your_classification_data.csv')
X = df.drop('target_column', axis=1)
y = df['target_column']

# Initialize the classifier
# scaled_data=True applies StandardScaler automatically
classifier = MultiModelClassifier(X, y, test_size=0.3, scaled_data=True)

# Train all models and get results
results = classifier.run_all_models()

Step 2: View Metrics & Best Model

Generates a clean dataframe of metrics (Accuracy, Precision, Recall, F1, AUC) and prints the best recommendation.

classifier.show_tabular_report(results)

Step 3: Visualize Confusion Matrices

Plots confusion matrices for every trained model with distinct color palettes.

classifier.plot_confusion_matrices(results)

Step 4: Plot ROC Curves

Overlays ROC curves for all models to compare Area Under the Curve (AUC) performance.

classifier.plot_roc_curves(results)

Step 5: Compare All Metrics

Plots a grouped bar chart comparing Accuracy, Precision, Recall, and F1 Score.

classifier.plot_comparison(results)

2. Regression Analysis

Use MultiModelRegressior for continuous target variables. It compares Linear Regression, Lasso, Ridge, SVR, Random Forest, Gradient Boosting, etc.

Step 1: Initialize and Train

from multimodel_analysis import MultiModelRegressior

# Load your dataset
df = pd.read_csv('your_regression_data.csv')
X = df.drop('price', axis=1)
y = df['price']

# Initialize the regressor
regressor = MultiModelRegressior(X, y, test_size=0.3, scaled_data=True)

# Train all models
results = regressor.run_all_models()

Step 2: View Metrics & Best Model

Generates a table of MAE, MSE, RMSE, and R2 Scores, and recommends the best model based on R2.

regressor.show_tabular_report(results)

Step 3: True vs. Predicted Plots

Visualizes the relationship between actual and predicted values with an ideal fit line.

regressor.plot_true_vs_predicted(results)

Step 4: Compare R2 Scores

Plots a bar chart to easily identify the model with the highest R2 score.

regressor.plot_comparison(results)

Key Features

🔹 Intelligent Automation

  • Automatic Scaling: Simply set scaled_data=True to standardize your features using StandardScaler before training.
  • Best Model Detection: Automatically highlights the best performing model based on Accuracy (Classification) or R2 Score (Regression).

🔹 Professional Visualizations

  • Colorful Confusion Matrices: Automatically cycles through color maps (Blues, Greens, Oranges, etc.) for distinct model visualization.
  • ROC Curve Overlays: clean comparison of True Positive vs False Positive rates.
  • Regression Fit Plots: Scatter plots with diagonal reference lines to visually assess regression performance.

🔹 Extensive Model Library

  • Classifiers: Logistic Regression, SVM, Decision Tree, KNN, Naive Bayes, Random Forest, Gradient Boosting, AdaBoost.
  • Regressors: Linear Regression, Lasso, Ridge, SVR, Decision Tree, Random Forest, Gradient Boosting.

👨‍💻 Author

Uditya Narayan Tiwari

📄 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

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

multimodel_analysis-0.0.1.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

multimodel_analysis-0.0.1-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file multimodel_analysis-0.0.1.tar.gz.

File metadata

  • Download URL: multimodel_analysis-0.0.1.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.4

File hashes

Hashes for multimodel_analysis-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ab406427379695e4cc278fe90ec8d7d8c04acdab1622518fc27d8d7b950a36f9
MD5 60bc884bc83fac63e8f5b4a3b771a0eb
BLAKE2b-256 e85017d80e1239e507259cedd4f6c0018b241ce30cf4f183b61443e8edfbb008

See more details on using hashes here.

File details

Details for the file multimodel_analysis-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for multimodel_analysis-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 683edc25f1adec8b7df62bbe568ce0ef4c4a084b7a4e458713c4da87ee1c7024
MD5 4ba24011eda0c63c5209efcf347fd6d9
BLAKE2b-256 be1a6ea40a2e3d6affe952045af54d6a337dfa0b926195865f921fb265668755

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