Skip to content

Commit 6771a69

Browse files
committed
fix kind of proxy for density estimation examples
1 parent a6bc77e commit 6771a69

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/src/fit_update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ which consumes no data, returns the learned density:
8585

8686
```julia
8787
model = fit(algorithm, y) # no features
88-
predict(model) # shortcut for `predict(model, Distribution())`, or similar
88+
predict(model) # shortcut for `predict(model, SingleDistribution())`, or similar
8989
```
9090

9191
A one-liner will typically be implemented as well:

test/patterns/incremental_algorithms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,25 @@ end
7070
LearnAPI.features(::NormalEstimator, y) = nothing
7171
LearnAPI.target(::NormalEstimator, y) = y
7272

73-
LearnAPI.predict(model::NormalEstimatorFitted, ::Distribution) =
73+
LearnAPI.predict(model::NormalEstimatorFitted, ::SingleDistribution) =
7474
Distributions.Normal(model.ȳ, sqrt(model.ss/model.n))
7575
LearnAPI.predict(model::NormalEstimatorFitted, ::Point) = model.
7676
function LearnAPI.predict(model::NormalEstimatorFitted, ::ConfidenceInterval)
77-
d = predict(model, Distribution())
77+
d = predict(model, SingleDistribution())
7878
return (quantile(d, 0.025), quantile(d, 0.975))
7979
end
8080

8181
# for fit and predict in one line:
8282
LearnAPI.predict(::NormalEstimator, k::LearnAPI.KindOfProxy, y) =
8383
predict(fit(NormalEstimator(), y), k)
84-
LearnAPI.predict(::NormalEstimator, y) = predict(NormalEstimator(), Distribution(), y)
84+
LearnAPI.predict(::NormalEstimator, y) = predict(NormalEstimator(), SingleDistribution(), y)
8585

8686
LearnAPI.extras(model::NormalEstimatorFitted) ==model.ȳ, σ=sqrt(model.ss/model.n))
8787

8888
@trait(
8989
NormalEstimator,
9090
constructor = NormalEstimator,
91-
kinds_of_proxy = (Distribution(), Point(), ConfidenceInterval()),
91+
kinds_of_proxy = (SingleDistribution(), Point(), ConfidenceInterval()),
9292
tags = ("density estimation", "incremental algorithms"),
9393
is_pure_julia = true,
9494
human_name = "normal distribution estimator",

0 commit comments

Comments
 (0)