Skip to content

Commit 20b4bff

Browse files
committed
rename fit.* -> fit_update.* and descriptors -> tags
1 parent 729e0d7 commit 20b4bff

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ makedocs(
1515
"Anatomy of an Implementation" => "anatomy_of_an_implementation.md",
1616
"Reference" => [
1717
"Overview" => "reference.md",
18-
"fit/update" => "fit.md",
18+
"fit/update" => "fit_update.md",
1919
"predict/transform" => "predict_transform.md",
2020
"Kinds of Target Proxy" => "kinds_of_target_proxy.md",
2121
"minimize" => "minimize.md",

docs/src/anatomy_of_an_implementation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ A macro provides a shortcut, convenient when multiple traits are to be defined:
220220
Ridge,
221221
constructor = Ridge,
222222
kinds_of_proxy=(LiteralTarget(),),
223-
descriptors = (:regression,),
223+
tags = (:regression,),
224224
functions = (
225225
:(LearnAPI.fit),
226226
:(LearnAPI.algorithm),
@@ -327,7 +327,7 @@ LearnAPI.minimize(model::RidgeFitted) =
327327
Ridge,
328328
constructor = Ridge,
329329
kinds_of_proxy=(LiteralTarget(),),
330-
descriptors = (:regression,),
330+
tags = (:regression,),
331331
functions = (
332332
:(LearnAPI.fit),
333333
:(LearnAPI.algorithm),
File renamed without changes.

docs/src/traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ package [ScientificTypesBase.jl](https://github.com/JuliaAI/ScientificTypesBase.
2525
| [`LearnAPI.constructor`](@ref)`(algorithm)` | constructor for generating new or modified versions of `algorithm` | (no fallback) | `RidgeRegressor` |
2626
| [`LearnAPI.functions`](@ref)`(algorithm)` | functions you can apply to `algorithm` or associated model (traits excluded) | `()` | `(:fit, :predict, :minimize, :(LearnAPI.algorithm), :obs)` |
2727
| [`LearnAPI.kinds_of_proxy`](@ref)`(algorithm)` | instances `kind` of `KindOfProxy` for which an implementation of `LearnAPI.predict(algorithm, kind, ...)` is guaranteed. | `()` | `(Distribution(), Interval())` |
28-
| [`LearnAPI.descriptors`](@ref)`(algorithm)` | lists one or more suggestive algorithm descriptors from `LearnAPI.descriptors()` | `()` | (:regression, :probabilistic) |
28+
| [`LearnAPI.tags`](@ref)`(algorithm)` | lists one or more suggestive algorithm tags from `LearnAPI.tags()` | `()` | (:regression, :probabilistic) |
2929
| [`LearnAPI.is_pure_julia`](@ref)`(algorithm)` | `true` if implementation is 100% Julia code | `false` | `true` |
3030
| [`LearnAPI.pkg_name`](@ref)`(algorithm)` | name of package providing core code (may be different from package providing LearnAPI.jl implementation) | `"unknown"` | `"DecisionTree"` |
3131
| [`LearnAPI.pkg_license`](@ref)`(algorithm)` | name of license of package providing core code | `"unknown"` | `"MIT"` |
@@ -114,7 +114,7 @@ informative (as in `LearnAPI.predict_type(algorithm) = Any`).
114114
LearnAPI.constructor
115115
LearnAPI.functions
116116
LearnAPI.kinds_of_proxy
117-
LearnAPI.descriptors
117+
LearnAPI.tags
118118
LearnAPI.is_pure_julia
119119
LearnAPI.pkg_name
120120
LearnAPI.pkg_license

src/LearnAPI.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import InteractiveUtils.subtypes
55
include("tools.jl")
66
include("types.jl")
77
include("predict_transform.jl")
8-
include("fit.jl")
8+
include("fit_update.jl")
99
include("minimize.jl")
1010
include("target_weights_features.jl")
1111
include("obs.jl")
File renamed without changes.

src/tools.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Overload a number of traits for algorithms of type `TypeEx`. For example, the co
1616
```julia
1717
@trait(
1818
RidgeRegressor,
19-
descriptors = ("regression", ),
19+
tags = ("regression", ),
2020
doc_url = "https://some.cool.documentation",
2121
)
2222
```
2323
2424
is equivalent to
2525
2626
```julia
27-
LearnAPI.descriptors(::RidgeRegressor) = ("regression", ),
27+
LearnAPI.tags(::RidgeRegressor) = ("regression", ),
2828
LearnAPI.doc_url(::RidgeRegressor) = "https://some.cool.documentation",
2929
```
3030

src/traits.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const TRAITS = [
2727
:constructor,
2828
:functions,
2929
:kinds_of_proxy,
30-
:descriptors,
30+
:tags,
3131
:is_pure_julia,
3232
:pkg_name,
3333
:pkg_license,
@@ -179,7 +179,7 @@ For more on target variables and target proxies, refer to the LearnAPI documenta
179179
"""
180180
kinds_of_proxy(::Any) = ()
181181

182-
descriptors() = [
182+
tags() = [
183183
"regression",
184184
"classification",
185185
"clustering",
@@ -206,12 +206,12 @@ descriptors() = [
206206
"image processing",
207207
]
208208

209-
const DOC_DESCRIPTORS_LIST = join(map(d -> "`\"$d\"`", descriptors()), ", ")
209+
const DOC_TAGS_LIST = join(map(d -> "`\"$d\"`", tags()), ", ")
210210

211211
"""
212-
LearnAPI.descriptors(algorithm)
212+
LearnAPI.tags(algorithm)
213213
214-
Lists one or more suggestive algorithm descriptors. Do `LearnAPI.descriptors()` to list
214+
Lists one or more suggestive algorithm tags. Do `LearnAPI.tags()` to list
215215
all possible.
216216
217217
!!! warning
@@ -223,7 +223,7 @@ all possible.
223223
This trait should return a tuple of strings, as in `("classifier", "text analysis")`.
224224
225225
"""
226-
descriptors(::Any) = ()
226+
tags(::Any) = ()
227227

228228
"""
229229
LearnAPI.is_pure_julia(algorithm)

test/integration/regression.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ LearnAPI.minimize(model::RidgeFitted) =
104104
Ridge,
105105
constructor = Ridge,
106106
kinds_of_proxy = (LiteralTarget(),),
107-
descriptors = ("regression",)
107+
tags = ("regression",)
108108
functions = (
109109
:(LearnAPI.fit),
110110
:(LearnAPI.algorithm),
@@ -237,7 +237,7 @@ LearnAPI.minimize(model::BabyRidgeFitted) =
237237
BabyRidge,
238238
constructor = BabyRidge,
239239
kinds_of_proxy = (LiteralTarget(),),
240-
descriptors = ("regression",)
240+
tags = ("regression",)
241241
functions = (
242242
:(LearnAPI.fit),
243243
:(LearnAPI.algorithm),

test/integration/static_algorithms.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ end
3939
@trait(
4040
Selector,
4141
constructor = Selector,
42-
descriptors = ("feature engineering",)
42+
tags = ("feature engineering",)
4343
functions = (
4444
:(LearnAPI.fit),
4545
:(LearnAPI.algorithm),
@@ -105,7 +105,7 @@ end
105105
Selector2,
106106
constructor = Selector2,
107107
predict_or_transform_mutates = true,
108-
descriptors = ("feature engineering",)
108+
tags = ("feature engineering",)
109109
functions = (
110110
:(LearnAPI.fit),
111111
:(LearnAPI.algorithm),

0 commit comments

Comments
 (0)