Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
bd5de3b
rm no longer applicable comment in docs
ablaom Oct 11, 2023
87495d5
rm another redundant comment
ablaom Oct 26, 2023
7d9dae0
minor doc fix
ablaom Oct 30, 2023
68aa9be
major refactor based on Julia Discourse feedback
ablaom Nov 1, 2023
2507568
rm redundant line from doc example
ablaom Nov 28, 2023
da2b607
spelling
ablaom Nov 28, 2023
417bd03
spelling again
ablaom Nov 28, 2023
c532f96
make codecov less fussy
ablaom Nov 28, 2023
71c57f4
bump Documenter version to 1.0
ablaom Nov 28, 2023
986192e
Merge pull request #25 from JuliaAI/camerons-suggestion
ablaom Nov 28, 2023
3efe48b
add MLUtils as docs [deps]
ablaom Nov 28, 2023
562f67a
revert repo kwarg in deploydocs to old string version
ablaom Nov 28, 2023
48c91eb
Merge pull request #26 from JuliaAI/fix-doc-generation
ablaom Nov 28, 2023
354210e
tweak
ablaom Nov 28, 2023
c08b3bb
doc tweak
ablaom Nov 28, 2023
0f39c91
spelling
ablaom Nov 28, 2023
e59e791
fix issue with predict_output_type
ablaom Nov 28, 2023
1fb6b4b
drop old names
ablaom Nov 28, 2023
7027ed8
sneak in doc fix
ablaom Nov 28, 2023
50e786d
Merge pull request #28 from JuliaAI/output-type-fix
ablaom Nov 28, 2023
48ab57f
rm duplicate method definition
ablaom Nov 28, 2023
d68a1e7
doc tweak
ablaom Nov 28, 2023
fabe6e0
doc tweak
ablaom Dec 4, 2023
43b11e3
docstring tweak
ablaom Dec 4, 2023
06c0862
docstring fix
ablaom Dec 4, 2023
9745ea9
docstring fix
ablaom Dec 4, 2023
c35ebf7
doc tweak
ablaom Dec 4, 2023
0d423c1
doc fix
ablaom Dec 5, 2023
b875de2
doc enhancement
ablaom Dec 6, 2023
d59c534
doc tweak
ablaom Dec 6, 2023
86ba3d5
doc tweaks
ablaom Dec 6, 2023
b53d2fd
doc tweak
ablaom May 10, 2024
b60fc22
simplify, removing in particular, obsfit, obspredict, obstransform
ablaom May 19, 2024
d47cabe
rm redundant pkg from [extras]
ablaom May 19, 2024
f0c68d5
fix typos
ablaom May 19, 2024
3252e09
more doc tweaks
ablaom May 20, 2024
69bd859
fix table of contents for the docs
ablaom May 28, 2024
f4b0fdd
tweak
ablaom May 28, 2024
acac24f
doc tweak
ablaom May 28, 2024
3b289f5
tweak
ablaom May 28, 2024
d6c320f
whitespace fixes
ablaom May 28, 2024
54a5f9b
fix whitespace
ablaom May 28, 2024
0af5476
clarify importance of constructor over type in traits and docstrings
ablaom May 30, 2024
4b7c09c
add Expectile and Quantile target proxy types
ablaom Jun 13, 2024
82ade40
add target_observation_scitype
ablaom Sep 8, 2024
7a781a0
more doc updates
ablaom Sep 24, 2024
31c42c6
add fallbacks to reduce need to overload some convenience methods
ablaom Sep 26, 2024
79c67e3
add fallbacks to rm need for overloading predict convenience fn
ablaom Sep 26, 2024
d270229
add some forgotten files
ablaom Sep 26, 2024
6e721c8
doc updates and some small re-organziation of code
ablaom Sep 26, 2024
729e0d7
complete addition of update methods + other tweaks
ablaom Oct 1, 2024
20b4bff
rename fit.* -> fit_update.* and descriptors -> tags
ablaom Oct 1, 2024
1a92f47
tweak
ablaom Oct 1, 2024
d1f3259
teak target_observation_scitype
ablaom Oct 1, 2024
d69c5b0
purge a bunch of traits related to predict/transform input/output
ablaom Oct 1, 2024
11b38cf
rename LiteralTarget -> Point
ablaom Oct 1, 2024
8fd02c9
fix typos
ablaom Oct 2, 2024
60f8b6c
fix syntax error in test
ablaom Oct 2, 2024
e25e4e7
add julia 1.10 testing to matrix
ablaom Oct 2, 2024
f2d4df8
Merge pull request #30 from JuliaAI/simplification
ablaom Oct 2, 2024
aabdfa5
typo
ablaom Oct 2, 2024
a3ece5c
typo
ablaom Oct 2, 2024
b5cdd78
update readme
ablaom Oct 2, 2024
ec3223c
typos
ablaom Oct 2, 2024
6adca0b
typo
ablaom Oct 2, 2024
dd0799e
doc tweak
ablaom Oct 2, 2024
a0f8934
clarify alternative data patterns in "anatomy of an interface"
ablaom Oct 2, 2024
56bea37
doc formatting
ablaom Oct 2, 2024
43a1ef5
typo
ablaom Oct 2, 2024
bce74cf
doc tweaks
ablaom Oct 2, 2024
3929714
tweak
ablaom Oct 2, 2024
d743d7d
typo
ablaom Oct 2, 2024
d59fb98
doc tweak
ablaom Oct 2, 2024
84ef5fc
update readme
ablaom Oct 3, 2024
15340c1
readme tweak
ablaom Oct 3, 2024
4d53e3c
typo
ablaom Oct 3, 2024
8e47d30
add Cameron to credits
ablaom Oct 4, 2024
29ccc3b
fix formatting in roadmap
ablaom Oct 4, 2024
511ce6c
add LearnAPI.clone; tweak contract for update
ablaom Oct 6, 2024
db2f287
fix problem with runtests.jl
ablaom Oct 6, 2024
72009e2
tweaks and corrections
ablaom Oct 7, 2024
1530a84
add iterative algorithms to integration tests
ablaom Oct 7, 2024
7d45e08
other tweaks
ablaom Oct 7, 2024
82a9e68
add trait tests
ablaom Oct 7, 2024
6da8531
dump `predict_or_transform_mutates` in favour of `is_static`
ablaom Oct 7, 2024
aa8f9de
doc string typo
ablaom Oct 7, 2024
5afe7ac
doc correction
ablaom Oct 8, 2024
f690c44
tweak
ablaom Oct 8, 2024
2312c1d
tweak
ablaom Oct 8, 2024
02af766
tweak
ablaom Oct 8, 2024
040adcd
tweak
ablaom Oct 8, 2024
1f78154
add tests
ablaom Oct 10, 2024
083bae9
add test for fit fallback
ablaom Oct 10, 2024
d792e51
fix a mistake in implementation of Ensemble
ablaom Oct 11, 2024
43db086
some minor file re-organization
ablaom Oct 11, 2024
40fd773
add a perceptron classifier to examples
ablaom Oct 11, 2024
0929066
update roadmap
ablaom Oct 11, 2024
671491c
fix outdated file reference in tests
ablaom Oct 11, 2024
458b03c
fix flawed test
ablaom Oct 11, 2024
a33bea4
Merge pull request #31 from JuliaAI/update_observations
ablaom Oct 11, 2024
8360ad4
doc tweaks
ablaom Oct 11, 2024
1e504fe
replace minimize -> LearnAPI.strip
ablaom Oct 11, 2024
55caed4
doc tweak
ablaom Oct 11, 2024
1e9d5e5
rename a struct in a test
ablaom Oct 11, 2024
21383ab
typo
ablaom Oct 11, 2024
3a56ad3
rename a struct in tests
ablaom Oct 11, 2024
f3afd36
rename test/integration folder test/patterns
ablaom Oct 11, 2024
168e0c6
tweaks
ablaom Oct 11, 2024
a683c93
add a observation-updatable density estimator to tests
ablaom Oct 11, 2024
9b9e4d4
typo
ablaom Oct 11, 2024
d82eaa5
add a test for predict and transform slurping fallbacks
ablaom Oct 11, 2024
c1d4220
Merge pull request #32 from JuliaAI/incremental
ablaom Oct 11, 2024
d4546c3
improve coverage
ablaom Oct 11, 2024
893b138
improve coverage
ablaom Oct 11, 2024
d5411e5
Merge branch 'coverage' of https://github.com/JuliaAI/MLInterface.jl …
ablaom Oct 11, 2024
92e5e3b
fix duplication
ablaom Oct 11, 2024
83e56bf
Merge pull request #33 from JuliaAI/coverage
ablaom Oct 11, 2024
2bdfece
update codecov to v4
ablaom Oct 11, 2024
45ee2a6
update codecov badge
ablaom Oct 12, 2024
e9c39a8
Merge pull request #34 from JuliaAI/coverage
ablaom Oct 12, 2024
fd672ca
fix formatting mistake
ablaom Oct 11, 2024
0605baa
ditto
ablaom Oct 11, 2024
ac5419b
remove slurping fallback signatures
ablaom Oct 13, 2024
c71298e
fix some mistakes
ablaom Oct 13, 2024
6242737
typo
ablaom Oct 13, 2024
7f1d537
Merge pull request #35 from JuliaAI/no-slurping
ablaom Oct 13, 2024
76a3df8
doc tweaks
ablaom Oct 13, 2024
36112ad
minor fixes
ablaom Oct 14, 2024
a6bc77e
readme tweak
ablaom Oct 14, 2024
6771a69
fix kind of proxy for density estimation examples
ablaom Oct 14, 2024
cf56728
drop some fluff from docs/index.md
ablaom Oct 14, 2024
f014c8d
doc and test tweaks
ablaom Oct 15, 2024
8a00b3b
fix codecov.yml
ablaom Oct 15, 2024
249e1e8
Merge pull request #36 from JuliaAI/tweaks
ablaom Oct 15, 2024
e9f863b
add test
ablaom Oct 15, 2024
d48d417
typos
ablaom Oct 16, 2024
04fc5c0
Merge pull request #37 from JuliaAI/tweaks
ablaom Oct 16, 2024
01245ba
use "learner" instead of "algorithm"
ablaom Oct 18, 2024
28ac859
doc tweak
ablaom Oct 18, 2024
059a6b4
get rid of InteractiveUtils dep
ablaom Oct 18, 2024
7ae83b0
add test
ablaom Oct 18, 2024
2b003bb
Merge pull request #38 from JuliaAI/learners
ablaom Oct 18, 2024
a156d46
update readme re algorithm -> learner
ablaom Oct 23, 2024
f433d50
upate again
ablaom Oct 23, 2024
63f2f0d
fix doc string
ablaom Oct 23, 2024
5e60305
doc tweak
ablaom Oct 23, 2024
4b9bc5b
give LearnAPI.functions() a default
ablaom Oct 25, 2024
099d86e
add test
ablaom Oct 25, 2024
bec86e4
typo
ablaom Oct 25, 2024
6f436ef
tweak a docstring
ablaom Oct 25, 2024
7f79538
remove testing of patterns
ablaom Oct 27, 2024
8da527b
add tests
ablaom Oct 27, 2024
bc7aff1
drop julia 1.6 support
ablaom Oct 27, 2024
ddcc2dc
dump test dependencies no longer needed
ablaom Oct 27, 2024
04393f0
bump compat julia=1.10
ablaom Oct 27, 2024
2836199
bump compat for docs
ablaom Oct 27, 2024
318d84f
fix a tag
ablaom Oct 27, 2024
1b8be29
whitespace
ablaom Oct 27, 2024
2ed8af3
docstring tweak
ablaom Oct 28, 2024
2b11e6b
clarify need for `obs` to be involutive
ablaom Oct 30, 2024
1c7123f
remove testing of patterns
ablaom Oct 27, 2024
6972617
add tests
ablaom Oct 27, 2024
0685024
drop julia 1.6 support
ablaom Oct 27, 2024
c5cbeb9
dump test dependencies no longer needed
ablaom Oct 27, 2024
5eee97c
bump compat julia=1.10
ablaom Oct 27, 2024
a3354c4
bump compat for docs
ablaom Oct 27, 2024
a4bfd9a
fix a tag
ablaom Oct 27, 2024
7e72784
whitespace
ablaom Oct 27, 2024
69fbfeb
add links to dim-reduction pattern; correct "ensembling" tag
ablaom Oct 30, 2024
0d66698
add data intrfce rqrmnt on output of `features`, `target`, `weights`
ablaom Oct 30, 2024
12b8f4b
add to docs: fit/predict/trans must support subsampled data
ablaom Nov 1, 2024
ec42302
doc tweak
ablaom Nov 1, 2024
3ed7301
fix a docstring
ablaom Nov 1, 2024
c85f3dc
Merge branch 'test-coverage' of https://github.com/JuliaAI/MLInterfac…
ablaom Nov 2, 2024
9d35cb9
typos
ablaom Nov 2, 2024
fc85531
Merge pull request #40 from JuliaAI/test-coverage
ablaom Nov 2, 2024
1a235f1
remove redundant files
ablaom Nov 2, 2024
cb8133d
fix links for patterns to point to LearnTestAPI.jl
ablaom Nov 2, 2024
dbb5ba6
add default_verbosity
ablaom Nov 2, 2024
b945e73
fix anatomy of an interface re verbosity
ablaom Nov 2, 2024
c9dbcc7
Merge pull request #41 from JuliaAI/remove-patterns
ablaom Nov 2, 2024
1f0468d
Merge pull request #42 from JuliaAI/verbosity
ablaom Nov 2, 2024
f6d8358
doc fix
ablaom Nov 2, 2024
1647461
Merge pull request #43 from JuliaAI/verbosity
ablaom Nov 2, 2024
d6cd610
tweak docs
ablaom Nov 2, 2024
14c6a16
tweak a docstring
ablaom Nov 2, 2024
49ce36b
typo
ablaom Nov 2, 2024
33f228e
fix some links
ablaom Nov 2, 2024
f30880d
typo
ablaom Nov 2, 2024
41ecbf3
typo
ablaom Nov 3, 2024
242cb34
doc tweak
ablaom Nov 3, 2024
5e08aab
doc tweak
ablaom Nov 3, 2024
962ec13
add feature_names to accessor functions
ablaom Nov 3, 2024
1449814
update docs feature_names
ablaom Nov 3, 2024
105d7ff
more doc tweaks
ablaom Nov 22, 2024
07c815e
fix bad urls
ablaom Nov 23, 2024
8e8123a
doc improvements
ablaom Dec 15, 2024
6279b25
add @functions and have `LearnAPI.functions()` return accessors
ablaom Dec 16, 2024
dff3cde
typo
ablaom Dec 20, 2024
e4bdbbb
typo
ablaom Dec 20, 2024
f4aed66
typo
ablaom Dec 20, 2024
1e946cf
make multi changes to accssr fnctns; add clone to functions()
ablaom Dec 28, 2024
d37e60e
replace is_composite trait with nonlearners trait
ablaom Jan 23, 2025
d6f8cec
add DocumenterInterLinks
ablaom Jan 23, 2025
d21c403
fix typos
ablaom Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
threshold: 0.5%
removed_code_behavior: fully_covered_patch
patch:
default:
target: 80
13 changes: 13 additions & 0 deletions .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Spell Check

on: [pull_request]

jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@master
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6'
- '1.10' # LTS release
- '1' # automatically expands to the latest stable 1.x release of Julia.
os:
- ubuntu-latest
Expand All @@ -44,9 +44,11 @@ jobs:
env:
JULIA_NUM_THREADS: 2
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true
docs:
name: Documentation
runs-on: ubuntu-latest
Expand All @@ -65,4 +67,4 @@ jobs:
using Documenter: DocMeta, doctest
using LearnAPI
DocMeta.setdocmeta!(LearnAPI, :DocTestSetup, :(using LearnAPI); recursive=true)
doctest(LearnAPI)'
doctest(LearnAPI)'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

MIT License Copyright (c) 2021 - JuliaAI
MIT License Copyright (c) 2024 - Anthony Blaom

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 2 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ uuid = "92ad9a40-7767-427a-9ee6-6e577f1266cb"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "0.1.0"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
julia = "1.6"
julia = "1.10"

[extras]
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["SparseArrays", "Test"]
test = ["Test",]
60 changes: 43 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,53 @@

A base Julia interface for machine learning and statistics

[![Lifecycle:Maturing](https://img.shields.io/badge/Lifecycle-Maturing-007EC6)](ROADMAP.md)
[![Build Status](https://github.com/JuliaAI/LearnAPI.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/LearnAPI.jl/actions)
[![codecov](https://codecov.io/gh/JuliaAI/LearnAPI.jl/graph/badge.svg?token=9IWT9KYINZ)](https://codecov.io/gh/JuliaAI/LearnAPI.jl?branch=dev)
[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliaai.github.io/LearnAPI.jl/dev/)

**Devlopement Status:**
Comprehensive documentation is [here](https://juliaai.github.io/LearnAPI.jl/dev/).

- [X] Detailed proposal stage ([this
documentation](https://juliaai.github.io/LearnAPI.jl/dev/)).
- [ ] Initial feedback stage (opened mid-January, 2023). General feedback can be provided at [this Julia Discourse thread](https://discourse.julialang.org/t/ann-learnapi-jl-proposal-for-a-basement-level-machine-learning-api/93048/20).
- [ ] Implement feedback and finish "To do" list (below)
- [ ] Proof of concept implementation
- [ ] Polish
- [ ] **Register 0.2.0**
New contributions welcome. See the [road map](ROADMAP.md).

You can join a discussion on the LearnAPI proposal at [this](https://discourse.julialang.org/t/ann-learnapi-jl-proposal-for-a-basement-level-machine-learning-api/93048) Julia Discourse thread.
## Code snippet

To do:
Configure a machine learning algorithm:

- [ ] Add methods to create/save persistent representation of learned parameters
- [ ] Add more repo tests
- [ ] Add methods to test an implementation
- [ ] Add user guide ("Common Implementation Patterns" section of manual)
```julia
julia> ridge = Ridge(lambda=0.1)
```

[![Build Status](https://github.com/JuliaAI/LearnAPI.jl/workflows/CI/badge.svg)](https://github.com/JuliaAI/LearnAPI.jl/actions)
[![Coverage](https://codecov.io/gh/JuliaAI/LearnAPI.jl/branch/master/graph/badge.svg)](https://codecov.io/github/JuliaAI/LearnAPI.jl?branch=master)
[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliaai.github.io/LearnAPI.jl/dev/)
Inspect available functionality:

```
julia> @functions ridge
(fit, LearnAPI.learner, LearnAPI.strip, obs, LearnAPI.features, LearnAPI.target, predict, LearnAPI.coefficients)
```

Train:

```julia
julia> model = fit(ridge, data)
```

Predict:

```julia
julia> predict(model, data)[1]
"virginica"
```

Predict a probability distribution ([proxy](https://juliaai.github.io/LearnAPI.jl/dev/kinds_of_target_proxy/#proxy_types) for the target):

```julia
julia> predict(model, Distribution(), data)[1]
UnivariateFinite{Multiclass{3}}(setosa=>0.0, versicolor=>0.25, virginica=>0.75)
```

## Credits

Created by Anthony Blaom, in cooperation with Cameron Bieganek and other [members of the
Julia
community](https://discourse.julialang.org/t/ann-learnapi-jl-proposal-for-a-basement-level-machine-learning-api/93048).

47 changes: 47 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Road map

- [ ] Mock up a challenging `update` use-case: controlling an iterative algorithm that
wants, for efficiency, to internally compute the out-of-sample predictions that will
be for used to *externally* determined early stopping cc: @jeremiedb

- [ ] Get code coverage to 100% (see next item)

- [ ] Add to this repo or a utility repo methods to test a valid implementation of
LearnAPI.jl

- [ ] Flush out "Common Implementation Patterns". The current plan is to mock up example
implementations, and add them as LearnAPI.jl tests, with links to the test file from
"Common Implementation Patterns". As real-world implementations roll out, we could
increasingly point to those instead, to conserve effort
- [x] regression
- [ ] classification
- [ ] clustering
- [x] gradient descent
- [x] iterative algorithms
- [ ] incremental algorithms
- [ ] dimension reduction
- [x] feature engineering
- [x] static algorithms
- [ ] missing value imputation
- [ ] transformers
- [x] ensemble algorithms
- [ ] time series forecasting
- [ ] time series classification
- [ ] survival analysis
- [ ] density estimation
- [ ] Bayesian algorithms
- [ ] outlier detection
- [ ] collaborative filtering
- [ ] text analysis
- [ ] audio analysis
- [ ] natural language processing
- [ ] image processing
- [ ] meta-algorithms

- [ ] In a utility package provide:
- [ ] Methods to facilitate common-use case data interfaces: support simultaneously
`fit` data of the form `data = (X, y)` where `X` is table *or* matrix, and `data` a
table with target specified by hyperparameter; here `obs` will return a thin wrapping
of the matrix of `X`, the target `y`, and the names of all fields. We can have
options to make `X` a concrete array or an adjoint, depending on what is more
efficient for the algorithm.
7 changes: 5 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
LearnAPI = "92ad9a40-7767-427a-9ee6-6e577f1266cb"
MLUtils = "f1d291b0-491e-4a28-83b9-f70985020b54"
ScientificTypesBase = "30f210dd-8aff-4c5f-94ba-8e64358c1161"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[compat]
Documenter = "^0.27"
julia = "1"
Documenter = "1"
julia = "1.10"
36 changes: 22 additions & 14 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
using Documenter
using LearnAPI
using ScientificTypesBase
using DocumenterInterLinks

const REPO="github.com/JuliaAI/LearnAPI.jl"
const REPO = Remotes.GitHub("JuliaAI", "LearnAPI.jl")

makedocs(;
makedocs(
modules=[LearnAPI,],
format=Documenter.HTML(prettyurls = get(ENV, "CI", nothing) == "true"),
format=Documenter.HTML(
prettyurls = true,#get(ENV, "CI", nothing) == "true",
collapselevel = 1,
),
pages=[
"Overview" => "index.md",
"Goals and Approach" => "goals_and_approach.md",
"Home" => "index.md",
"Anatomy of an Implementation" => "anatomy_of_an_implementation.md",
"Reference" => "reference.md",
"Fit, update and ingest" => "fit_update_and_ingest.md",
"Predict and other operations" => "operations.md",
"Accessor Functions" => "accessor_functions.md",
"Optional Data Interface" => "optional_data_interface.md",
"Algorithm Traits" => "algorithm_traits.md",
"Reference" => [
"Overview" => "reference.md",
"fit/update" => "fit_update.md",
"predict/transform" => "predict_transform.md",
"Kinds of Target Proxy" => "kinds_of_target_proxy.md",
"obs and Data Interfaces" => "obs.md",
"target/weights/features" => "target_weights_features.md",
"Accessor Functions" => "accessor_functions.md",
"Learner Traits" => "traits.md",
],
"Common Implementation Patterns" => "common_implementation_patterns.md",
"Testing an Implementation" => "testing_an_implementation.md",
],
repo="https://$REPO/blob/{commit}{path}#L{line}",
sitename="LearnAPI.jl"
sitename="LearnAPI.jl",
warnonly = [:cross_references, :missing_docs],
repo = Remotes.GitHub("JuliaAI", "LearnAPI.jl"),
)

deploydocs(
; repo=REPO,
devbranch="dev",
push_preview=false,
repo="github.com/JuliaAI/LearnAPI.jl.git",
)
51 changes: 44 additions & 7 deletions docs/src/accessor_functions.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,53 @@
# Accessor Functions
# [Accessor Functions](@id accessor_functions)

> **Summary.** While byproducts of training are ordinarily recorded in the `report`
> component of the output of `fit`/`update!`/`ingest!`, some families of algorithms report an
> item that is likely shared by multiple algorithm types, and it is useful to have common
> interface for accessing these directly. Training losses and feature importances are two
> examples.
The sole argument of an accessor function is the output, `model`, of
[`fit`](@ref). Learners are free to implement any number of these, or none of them. Only
`LearnAPI.strip` has a fallback, namely the identity.

- [`LearnAPI.learner(model)`](@ref)
- [`LearnAPI.extras(model)`](@ref)
- [`LearnAPI.strip(model)`](@ref)
- [`LearnAPI.coefficients(model)`](@ref)
- [`LearnAPI.intercept(model)`](@ref)
- [`LearnAPI.tree(model)`](@ref)
- [`LearnAPI.trees(model)`](@ref)
- [`LearnAPI.feature_names(model)`](@ref)
- [`LearnAPI.feature_importances(model)`](@ref)
- [`LearnAPI.training_losses(model)`](@ref)
- [`LearnAPI.out_of_sample_losses(model)`](@ref)
- [`LearnAPI.predictions(model)`](@ref)
- [`LearnAPI.out_of_sample_indices(model)`](@ref)
- [`LearnAPI.training_scores(model)`](@ref)
- [`LearnAPI.components(model)`](@ref)

Learner-specific accessor functions may also be implemented. The names of all accessor
functions are included in the list returned by [`LearnAPI.functions(learner)`](@ref).

## Implementation guide

All new implementations must implement [`LearnAPI.learner`](@ref). While, all others are
optional, any implemented accessor functions must be added to the list returned by
[`LearnAPI.functions`](@ref).


## Reference

```@docs
LearnAPI.learner
LearnAPI.extras
LearnAPI.strip
LearnAPI.coefficients
LearnAPI.intercept
LearnAPI.tree
LearnAPI.trees
LearnAPI.feature_names
LearnAPI.feature_importances
LearnAPI.training_losses
LearnAPI.out_of_sample_losses
LearnAPI.predictions
LearnAPI.out_of_sample_indices
LearnAPI.training_scores
LearnAPI.training_labels
LearnAPI.components
```


Loading
Loading