Skip to main content

Graph-based evaluation engine for machine learning models

Project description

AI Critic 4.0.0 (Enhanced Edition)

pip install ai-critic

AI Critic is a graph-based evaluation engine for machine learning models.

Instead of isolated metrics, AI Critic runs a structured evaluation pipeline that analyzes multiple dimensions of model quality.

New in Version 4.0

  • Unified Core Architecture: Streamlined EvaluationNode and EvaluatorPlugin for easier extension.
  • Advanced Graph Engine: Real topological sorting of dependencies.
  • Parallel Execution: Run independent evaluators in parallel for faster results.
  • Weighted Aggregation: Control the importance of each evaluator in the final score.
  • Structured Reporting: New EvaluationReport object with JSON, Dict, and Text summary support.
  • Smart Suggestion Engine: Prioritized actionable advice based on evaluation results.

Quick Start

from ai_critic import AICritic
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris

# Load data and train model
data = load_iris()
X, y = data.data, data.target
model = RandomForestClassifier().fit(X, y)

# Initialize with custom weights
weights = {"performance": 1.0, "robustness": 1.5}
critic = AICritic(weights=weights)

# Evaluate (supports parallel execution)
report = critic.evaluate(model, X, y, parallel=True)

# Print summary
print(report.summary())

# Get AI suggestions
from ai_critic.ai_suggestions.rules import SuggestionEngine
suggestions = SuggestionEngine.suggest(report)
for s in suggestions:
    print(f"[{s['priority']}] {s['category']}: {s['message']}")

Core Components

1. Evaluation Graph

The engine automatically resolves dependencies between evaluators. For example, Robustness depends on Performance.

2. Weighted Aggregator

Individual scores are combined using a weighted average. You can define weights during AICritic initialization.

3. Evaluator Plugins

Creating custom evaluators is simple:

from ai_critic.plugins.base import EvaluatorPlugin
from ai_critic.plugins.registry import EvaluatorRegistry

class FairnessEvaluator(EvaluatorPlugin):
    name = "fairness"
    weight = 1.0
    dependencies = ["performance"]

    def evaluate(self, model, dataset, context=None):
        # Your logic here
        return {"score": 0.95, "message": "Fairness is high."}

# Register the plugin
EvaluatorRegistry.register(FairnessEvaluator())

CLI Usage

ai-critic --model model.pkl --data dataset.csv --target label --parallel

Design Philosophy

  1. Deterministic evaluation
  2. Modular & Parallel architecture
  3. Transparent & Actionable diagnostics

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

ai_critic-3.3.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

ai_critic-3.3.0-py3-none-any.whl (29.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_critic-3.3.0.tar.gz.

File metadata

  • Download URL: ai_critic-3.3.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for ai_critic-3.3.0.tar.gz
Algorithm Hash digest
SHA256 bc176ec7c7ba58e52a873f68be99680726f4659b050248740e61acc0f134c409
MD5 2b6b8ed31f33263a6a83524197384a6d
BLAKE2b-256 5f782d9aa05ec8c4496c891e3a5eb9717261cdcf8e188b240d3ec326910d45ee

See more details on using hashes here.

File details

Details for the file ai_critic-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: ai_critic-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for ai_critic-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 098bf236080ad1e052ce9a60032d15891b37acba7b927a7a0dc6d206825256ff
MD5 094d5360ebb0c43ade6fe7f0feb09901
BLAKE2b-256 bb9254555413c077ced43ef364547abc1499fd73534d8727a2f3be678d0266d2

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