Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliaai/mljtestinterface.jl
https://github.com/juliaai/mljtestinterface.jl
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/juliaai/mljtestinterface.jl
- Owner: JuliaAI
- License: mit
- Created: 2022-11-08T22:08:26.000Z (about 2 years ago)
- Default Branch: dev
- Last Pushed: 2024-02-16T04:07:15.000Z (9 months ago)
- Last Synced: 2024-10-17T12:42:22.895Z (27 days ago)
- Language: Julia
- Size: 129 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MLJTestInterface.jl
Package for testing an implementation of the
[MLJ](https://alan-turing-institute.github.io/MLJ.jl/dev/) model interface.[![Lifecycle:Experimental](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md) [![Build Status](https://github.com/JuliaAI/MLJTestInterface.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/MLJTestInterface.jl/actions) [![Coverage](https://codecov.io/gh/JuliaAI/MLJTestInterface.jl/branch/master/graph/badge.svg)](https://codecov.io/github/JuliaAI/MLJTestInterface.jl?branch=master)
# Installation
```julia
using Pkg
Pkg.add("MLJTestInterface")
```# Usage
To test that a collection of model types, `models`, satisfy the [MLJ model interface
requirements](https://alan-turing-institute.github.io/MLJ.jl/dev/adding_models_for_general_use/),
use the `MLJTestInterface.test` function:```julia
MLJTestInterface.test(models, data...; mod=Main, level=2, throw=false, verbosity=1)
-> failures, summary
```Here `data` is training data acceptable to all the specified `models`, as would appear in
a call `MLJModelInterface.fit(model_instance, verbosity, data...)`.For detailed documentation, run `using MLJTestInterface; @doc MLJTestInterface.test`.
# Example
The following tests the model interface implemented by the `DecisionTreeClassifier` model
implemented in the package MLJDecisionTreeInterface.jl.```julia
import MLJDecisionTreeInterface
import MLJTestInterface
using Test
X, y = MLJTestInterface.make_multiclass()
failures, summary = MLJTestInterface.test(
[MLJDecisionTreeInterface.DecisionTreeClassifier, ],
X, y,
verbosity=0, # set to 2 when debugging
throw=false, # set to `true` when debugging
mod=@__MODULE__,
)
@test isempty(failures)
```# Datasets
The following commands generate small datasets of the form `(X, y)` suitable for interface
tests:- `MLJTestInterface.make_binary(; row_table=false)`
- `MLJTestInterface.make_multiclass(; row_table=false)` `
- `MLJTestInterface.make_regression(; row_table=false)` `
- `MLJTestInterface.make_count(; row_table=false)` `