Code Monkey home page Code Monkey logo

giskard's Introduction

giskardlogo giskardlogo

The testing framework dedicated to ML models, from tabular to LLMs

Scan AI models to detect risks of biases, performance issues and errors. In 4 lines of code.

GitHub release GitHub build build Giskard on Discord

Documentation โ€ข Blog โ€ข Website โ€ข Discord Community โ€ข Advisors


Table of contents

  1. What is Giskard?
  2. Getting started
  1. How to contribute
  2. Like what we're doing?

What is Giskard?

Giskard is an open-source testing framework dedicated to ML models, from tabular models to LLMs.

Testing Machine Learning applications can be tedious. Since ML models depend on data, testing scenarios depend on the domain specificities and are often infinite.

Where to start testing? Which tests to implement? What issues to cover? How to implement the tests?

hey

At Giskard, we believe that Machine Learning needs its own testing framework. Created by ML engineers for ML engineers, Giskard enables you to:

  • Scan your model to find dozens of vulnerabilities: The Giskard scan automatically detects vulnerability issues such as performance bias, data leakage, unrobustness, spurious correlation, overconfidence, underconfidence, unethical issue, etc.

Scan Example

  • Instantaneously generate domain-specific tests: Giskard automatically generates relevant tests based on the vulnerabilities detected by the scan. You can easily customize the tests depending on your use case by defining domain-specific data slicers and transformers as fixtures of your test suites.

Scan Example

  • Leverage the Quality Assurance best practices of the open-source community: The Giskard catalog enables you to easily contribute and load data slicing & transformation functions such as AI-based detectors (toxicity, hate, etc.), generators (typos, paraphraser, etc.), or evaluators. Inspired by the Hugging Face philosophy, the aim of Giskard is to become the open-source hub of ML Quality Assurance.

Scan Example

And of course, Giskard works with any model, any environment and integrates seamlessly with your favorite tools โคต๏ธ


Getting started

Installation

pip install "giskard[server]>=2.0.0b" -U

giskard server start

That's it. Access at http://localhost:19000

Scan your model to detect vulnerabilities

After having wrapped your model & dataset, you can scan your model for vulnerabilities using:

import giskard
from giskard import demo

model, df = demo.titanic()

model = giskard.Model(model=model, model_type="classification")
dataset = giskard.Dataset(
    df=df,
    target="Survived",
    cat_columns=["Pclass", "Sex", "SibSp", "Parch", "Embarked"],
)

scan_results = giskard.scan(model, dataset)

Once the scan completes, you can display the results directly in your notebook:

display(scan_results)  # in your notebook

Automatically generate a test suite based on the scan results

If the scan found potential issues in your model, you can automatically generate a test suite.

Generating a test suite from your scan results will enable you to:

  • Turn the issues you found into actionable tests that you can directly integrate in your CI/CD pipeline
  • Diagnose your vulnerabilities and debug the issues you found in the scan
test_suite = scan_results.generate_test_suite("My first test suite")

# You can run the test suite locally to verify that it reproduces the issues
test_suite.run()

Upload your test suite to the Giskard server

You can then upload the test suite to the local Giskard server. This will enable you to:

  • Compare the quality of different models to decide which one to promote
  • Debug your tests to diagnose the identified issues
  • Create more domain-specific tests relevant to your use case
  • Share results, and collaborate with your team to integrate business feedback

First, install the Giskard server by following this documentation

# Create a Giskard client after having installed the Giskard server (see documentation)
token = "API_TOKEN"  # Find it in Settings in the Giskard server
client = GiskardClient(
    url="http://localhost:19000", token=token  # URL of your Giskard instance
)

my_project = client.create_project("my_project", "PROJECT_NAME", "DESCRIPTION")

# Upload to the current project
test_suite.upload(client, "my_project")

For more information on uploading to your local Giskard server, go to the Upload an object to the Giskard server page.

How to contribute

We welcome contributions from the Machine Learning community!

Read this guide to get started.


Like what we're doing?

๐ŸŒŸ Leave us a star, it helps the project to get discovered by others and keeps us motivated to build awesome open-source tools! ๐ŸŒŸ

โค๏ธ You can also sponsor us on GitHub. With a monthly sponsor subscription, you can get a sponsor badge and get your bug reports prioritized. We also offer one-time sponsoring if you want us to get involved in a consulting project, run a workshop, or give a talk at your company.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.