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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: decima2-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 d6a78b5a0f11e68332108cb048eb93211f3f80eb2ff308d34dc5ef407d49e0c6
MD5 220e2eceade7c9806abe1440d2948d3b
BLAKE2b-256 fcd1217a5f2d71d5c2d16dd25e18380c50827d80e37d23ae6df64f2dd49ed31d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: decima2-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07da4f5ced97af1dd44a9c6215a1e41a54656b20e38b6c0b3bdefd9a13e839bb
MD5 d8637a75829d63f7fb05a2d415112a81
BLAKE2b-256 36309360506b83ff712a1779b6cda7c032aa8288010ffdd702fa72f6608f537f

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