|
70 | 70 | LearnAPI.features(::NormalEstimator, y) = nothing
|
71 | 71 | LearnAPI.target(::NormalEstimator, y) = y
|
72 | 72 |
|
73 |
| -LearnAPI.predict(model::NormalEstimatorFitted, ::Distribution) = |
| 73 | +LearnAPI.predict(model::NormalEstimatorFitted, ::SingleDistribution) = |
74 | 74 | Distributions.Normal(model.ȳ, sqrt(model.ss/model.n))
|
75 | 75 | LearnAPI.predict(model::NormalEstimatorFitted, ::Point) = model.ȳ
|
76 | 76 | function LearnAPI.predict(model::NormalEstimatorFitted, ::ConfidenceInterval)
|
77 |
| - d = predict(model, Distribution()) |
| 77 | + d = predict(model, SingleDistribution()) |
78 | 78 | return (quantile(d, 0.025), quantile(d, 0.975))
|
79 | 79 | end
|
80 | 80 |
|
81 | 81 | # for fit and predict in one line:
|
82 | 82 | LearnAPI.predict(::NormalEstimator, k::LearnAPI.KindOfProxy, y) =
|
83 | 83 | predict(fit(NormalEstimator(), y), k)
|
84 |
| -LearnAPI.predict(::NormalEstimator, y) = predict(NormalEstimator(), Distribution(), y) |
| 84 | +LearnAPI.predict(::NormalEstimator, y) = predict(NormalEstimator(), SingleDistribution(), y) |
85 | 85 |
|
86 | 86 | LearnAPI.extras(model::NormalEstimatorFitted) = (μ=model.ȳ, σ=sqrt(model.ss/model.n))
|
87 | 87 |
|
88 | 88 | @trait(
|
89 | 89 | NormalEstimator,
|
90 | 90 | constructor = NormalEstimator,
|
91 |
| - kinds_of_proxy = (Distribution(), Point(), ConfidenceInterval()), |
| 91 | + kinds_of_proxy = (SingleDistribution(), Point(), ConfidenceInterval()), |
92 | 92 | tags = ("density estimation", "incremental algorithms"),
|
93 | 93 | is_pure_julia = true,
|
94 | 94 | human_name = "normal distribution estimator",
|
|
0 commit comments