Skip to main content

Evaluation Toolkit for Machine Learning Models

Project description

Decima2 AI Evaluation Toolkit

Introduction

Welcome to the Decima2 AI Evaluation Toolkit — a comprehensive suite of tools designed to empower developers with the insights needed to effectively evaluate and enhance machine learning models. Our toolkit focuses on making complex concepts in machine learning intuitive and accessible, allowing users to derive meaningful insights without the steep learning curve often associated with advanced analytics.

Table of Contents

  1. Installation
  2. Model Tools 2.1 Model Feature Importance
  3. Data Tools
  4. Outcome Tools
  5. License
  6. Contributing
  7. Contact

Installation

You can install the package using pip:

pip install decima2

Model Tools

Gain insights into how your models make predictions with clear, interpretable visualizations and explanations, making it easier to communicate results.

Model Feature Importance (Tabular)

Usage

Here’s a quick example of how to use model_feature_importance to evaluate a machine learning model and compute feature importances. We recommend using this explanation method on tabular (numerical) data with less than 100 fetures.

Example

Load Data and Train Your Model
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestClassifier

from decima2 import model_feature_importance

# Load your dataset
df = pd.read_csv('your_dataset.csv')
y = df['target']
X = df.drop(columns=['target'])

X_train, X_test, y_train, y_test = train_test_split(X y, test_size=0.20, random_state=42)
model = RandomForestClassifier(max_depth=100, random_state=42)
model.fit(X_train, y_train)

Call Model Feature Importance:


model_feature_importance(X, y, model, output='dynamic'):
    Generates explanations for the provided model, which can be returned as text, static image, or interactive app.
    Parameters:
    -----------
    - X: pandas DataFrame
        The feature matrix (input data) which was used to test the model. Each column should be of numeric type. 
    - y: pandas Series or Numpy array
        The target variable corresponding to X.
    - model: scikit-learn, Keras, Pytorch compatible model
        The machine learning model for which the feature importance and explanations are generated.
    - output: str, default='dynamic'
        The output type for explanations. Options include:
        - 'text': Returns a textual summary of feature importances.
        - 'static': Generates a static image visualizing feature importances.
        - 'dynamic': Returns an interactive dashboard (using Dash) for visualizing feature importances.

    Returns:
    --------
    - Depending on the `output` argument, the function returns either:
      - A textual summary of feature names with their importances,
      - A static Plotly figure visualizing feature importances, or
      - An interactive Dash app for exploring feature importances dynamically.
Generate Explanations and View Via Interactive App
explanation_app = model_feature_importance(X_test,y_test,model,output='dynamic')
explanation_app.run_server()
Generate Explanations and View Via Static Graph
explanation_plot = model_feature_importance(X_test,y_test,model,output='static')
Generate Explanations and View Via Text
explanations = model_feature_importance(X_test,y_test,model,output='text')
print(explanations)

Data Tools

Coming Soon

These tools help you evaluate your data

Outcome Tools

Coming Soon

These tools help you to evaluate the outcomes of your model

License

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

Contributing

Contributions are welcome! Please create a pull request or open an issue for any improvements, bugs, or feature requests.

Contact

For inquiries, please reach out to tortysivill@decima2.co.uk

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

decima2-0.1.1.tar.gz (23.2 kB view details)

Uploaded Source

Built Distribution

decima2-0.1.1-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file decima2-0.1.1.tar.gz.

File metadata

  • Download URL: decima2-0.1.1.tar.gz
  • Upload date:
  • Size: 23.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for decima2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a7271c219937edca9e17fda69e45bff40f7eeb1b7979f53a3028cb82ee30366a
MD5 c9671051e56356163bb1e17945529f72
BLAKE2b-256 b2d8f204d3a03474261333d32d55bbe24e27868e52efa9ef5eaf4cbb35d945da

See more details on using hashes here.

File details

Details for the file decima2-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: decima2-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for decima2-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 95a47d3d6033e0e7eaf88d8da7e08f22c55505b66232f3939d1afee8d6f91360
MD5 2f443cb8a2a1248520134f52792656e2
BLAKE2b-256 9ff61bf4253994886303253b180b8d8071f2f3a598d78bbaf684363f6729e74a

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