From 9a4dad757329b1581c5f751067a06b3c7a57e7f9 Mon Sep 17 00:00:00 2001 From: Nicholas Robinson Date: Fri, 20 Mar 2020 18:06:27 +0000 Subject: [PATCH] Fix docs links; add more @refs --- README.md | 11 +++++------ src/Models.jl | 7 ++++--- src/test_utils.jl | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d9eff85..4819173 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/src/Models.jl b/src/Models.jl index 82ff847..e6755f9 100644 --- a/src/Models.jl +++ b/src/Models.jl @@ -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 diff --git a/src/test_utils.jl b/src/test_utils.jl index eced3cc..abbb480 100644 --- a/src/test_utils.jl +++ b/src/test_utils.jl @@ -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