Skip to content

Commit

Permalink
Merge branch 'npr/doc-refs' into 'master'
Browse files Browse the repository at this point in the history
Fix docs links; add more @refs

See merge request invenia/research/Models.jl!3
  • Loading branch information
nickrobinson251 committed Mar 20, 2020
2 parents fda8a69 + 9a4dad7 commit de5d4ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Models

[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.pages.invenia.ca/Models.jl/)
[![Build Status](https://gitlab.invenia.ca/invenia/Models.jl/badges/master/build.svg)](https://gitlab.invenia.ca/invenia/Models.jl/commits/master)
[![Latest](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.pages.invenia.ca/research/Models.jl/)
[![Coverage](https://gitlab.invenia.ca/invenia/Models.jl/badges/master/coverage.svg)](https://gitlab.invenia.ca/invenia/Models.jl/commits/master)

## Why does this package exist?

[Models.jl](https://gitlab.invenia.ca/invenia/research/Models.jl) defines the [`Template`](@ref) and [`Model`](@ref) types as well as a common API for constructing a generic model in downstream packages, including:

* Calling [`fit`](@ref) on a [`Template`](@ref).
* Calling [`predict`](@ref) on a [`Model`](@ref).
* Assigning traits such as [`EstimateTrait`](@ref) and [`OutputTrait`](@ref).
* Testing interfaces and downstream dependencies with [`TestUtils`](@ref).
* Calling `fit` on a `Template`.
* Calling `predict` on a `Model`.
* Assigning traits such as `EstimateTrait` and `OutputTrait`.
* Testing interfaces and downstream dependencies with `TestUtils`.

For common examples of the interface being implemented see [BaselineModels.jl](https://gitlab.invenia.ca/invenia/research/BaselineModels.jl).
7 changes: 4 additions & 3 deletions src/Models.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ abstract type Model end
"""
fit(::Template, output, input) -> Model
Fit the `Template` to the `output` and `input` data and return a trained `Model`.
Fit the [`Template`](@ref) to the `output` and `input` data and return a trained
[`Model`](@ref).
"""
function fit end

"""
predict(::Model, input)
Predict targets for the provided `input` and `Model`.
Predict targets for the provided `input` and [`Model`](@ref).
Returns a predictive distribution or point estimates depending on the `Model`.
Returns a predictive distribution or point estimates depending on the [`Model`](ref).
"""
function predict end

Expand Down
6 changes: 3 additions & 3 deletions src/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ purposes. It should be defined (before fitting) with a `predictor`, which can be
mutating the field.
## Fields
- `predictor::Function`: predicts the outputs of the FakeModel.
- `predictor::Function`: predicts the outputs of the [`FakeModel`](@ref).
It is `(num_variates, inputs) -> outputs`, where the `num_variates` will be memorized
during `fit`.
## Methods
- `fit` does not learn anything it just creates an instance of the model
- `predict` applies the `predictor` to the inputs
- [`fit`](@ref) does not learn anything, it just creates an instance of the corresponding [`Model`](@ref).
- [`predict`](@ref) applies the `predictor` to the inputs.
"""
mutable struct FakeTemplate{E<:EstimateTrait, O<:OutputTrait} <: Template
predictor::Function
Expand Down

0 comments on commit de5d4ad

Please sign in to comment.