diff --git a/docs/Project.toml b/docs/Project.toml index 30f1981a..4ffd503c 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -2,6 +2,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656" LearnAPI = "92ad9a40-7767-427a-9ee6-6e577f1266cb" +LearnTestAPI = "3111ed91-c4f2-40e7-bb19-7f6c618409b8" MLCore = "c2834f40-e789-41da-a90e-33b280584a8c" ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" diff --git a/docs/make.jl b/docs/make.jl index dbe4e333..ff506233 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,5 +1,6 @@ using Documenter using LearnAPI +using LearnTestAPI using ScientificTypesBase using DocumenterInterLinks # using LearnTestAPI @@ -7,7 +8,7 @@ using DocumenterInterLinks const REPO = Remotes.GitHub("JuliaAI", "LearnAPI.jl") makedocs( - modules=[LearnAPI, ], #LearnTestAPI], + modules=[LearnAPI, LearnTestAPI], format=Documenter.HTML( prettyurls = true,#get(ENV, "CI", nothing) == "true", collapselevel = 1, diff --git a/docs/src/anatomy_of_an_implementation.md b/docs/src/anatomy_of_an_implementation.md index 806ca9bb..3c4bb757 100644 --- a/docs/src/anatomy_of_an_implementation.md +++ b/docs/src/anatomy_of_an_implementation.md @@ -44,7 +44,7 @@ refer to the [demonstration](@ref workflow) of the implementation given later. 1. Implement `fit` (probably following an existing example). Read the [`fit`](@ref) document string to see what else may need to be implemented, paying particular attention to the "New implementations" section. 3. Rinse and repeat with each new method implemented. 4. Identify any additional [learner traits](@ref traits) that have appropriate overloadings; use the [`@trait`](@ref) macro to define these in one block. - 5. Ensure your implementation includes the compulsory method [`LearnAPI.learner`](@ref) and compulsory traits [`LearnAPI.constructor`](@ref) and [`LearnAPI.functions`](@ref). Read and apply "[Testing your implementation](@ref)". + 5. Ensure your implementation includes the compulsory method [`LearnAPI.learner`](@ref) and compulsory traits [`LearnAPI.constructor`](@ref) and [`LearnAPI.functions`](@ref). Read and apply "[Testing an Implementation](@ref)". If you get stuck, refer back to this tutorial and the [Reference](@ref reference) sections. diff --git a/docs/src/common_implementation_patterns.md b/docs/src/common_implementation_patterns.md index 9573c0d9..b2914626 100644 --- a/docs/src/common_implementation_patterns.md +++ b/docs/src/common_implementation_patterns.md @@ -11,7 +11,7 @@ which introduces the main interface objects and terminology. Although an implementation is defined purely by the methods and traits it implements, many implementations fall into one (or more) of the informally understood patterns or tasks below. While some generally fall into one of the core `Descriminative`, `Generative` or -`Static` patterns detailed [here](@id kinds_of_learner), there are exceptions (such as +`Static` patterns detailed [here](@ref kinds_of_learner), there are exceptions (such as clustering, which has both `Descriminative` and `Static` variations). - [Regression](@ref): Supervised learners for continuous targets diff --git a/docs/src/testing_an_implementation.md b/docs/src/testing_an_implementation.md index 6dd625cc..ebcf64ae 100644 --- a/docs/src/testing_an_implementation.md +++ b/docs/src/testing_an_implementation.md @@ -2,56 +2,67 @@ Testing is provided by the LearnTestAPI.jl package. - +Testing is provided by the LearnTestAPI.jl package documented below. - +## Quick start - - - +```@docs +LearnTestAPI +``` - +!!! warning - - - - - + New releases of LearnTestAPI.jl may add tests to `@testapi`, and + this may result in new failures in client package test suites, because + of previously undetected broken contracts. Adding a test to `@testapi` + is not considered a breaking change + to LearnTestAPI, unless it supports a breaking change to LearnAPI.jl. - +## The @testapi macro - - - +```@docs +LearnTestAPI.@testapi +``` - +## Learners for testing - - +LearnTestAPI.jl provides some simple, tested, LearnAPI.jl implementations, which may be +useful for testing learner wrappers and meta-algorithms. - - - - - - - - - - - +- [`LearnTestAPI.Ridge`](@ref) +- [`LearnTestAPI.BabyRidge`](@ref) +- [`LearnTestAPI.ConstantClassifier`](@ref) +- [`LearnTestAPI.TruncatedSVD`](@ref) +- [`LearnTestAPI.Selector`](@ref) +- [`LearnTestAPI.FancySelector`](@ref) +- [`LearnTestAPI.NormalEstimator`](@ref) +- [`LearnTestAPI.Ensemble`](@ref) +- [`LearnTestAPI.StumpRegressor`](@ref) - - +```@docs +LearnTestAPI.Ridge +LearnTestAPI.BabyRidge +LearnTestAPI.ConstantClassifier +LearnTestAPI.TruncatedSVD +LearnTestAPI.Selector +LearnTestAPI.FancySelector +LearnTestAPI.NormalEstimator +LearnTestAPI.Ensemble +LearnTestAPI.StumpRegressor +``` - - - - - - - - - +## Private methods + +For LearnTestAPI.jl developers only, and subject to breaking changes at any time: + +```@docs +LearnTestAPI.@logged_testset +LearnTestAPI.@nearly +LearnTestAPI.isnear +LearnTestAPI.learner_get +LearnTestAPI.model_get +LearnTestAPI.verb +LearnTestAPI.filter_out_verbosity +``` diff --git a/src/types.jl b/src/types.jl index 43dd420e..1ac66d08 100644 --- a/src/types.jl +++ b/src/types.jl @@ -146,7 +146,7 @@ following must hold: - The ``j``th observation of `ŷ`, for any ``j``, depends only on the ``j``th observation of the provided `data` (no correlation between observations). -An exception holds in the case that [`LearnAPI.kind_of(learner)`](@ref)` == +An exception holds in the case that [`LearnAPI.kind_of(learner)`](@ref)` == ` [`LearnAPI.Generative()`](@ref): - `LearnAPI.predict(model, kind_of_proxy)` consists of a single observation (such as a