Skip to content

Commit 2419605

Browse files
anthonyanthony
authored andcommitted
bump [compat] LearnAPI = "1" and address breakages
1 parent 0a82ccd commit 2419605

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ComputationalResources = "0.3"
4646
DelimitedFiles = "1"
4747
Distributions = "0.25.3"
4848
InvertedIndices = "1"
49-
LearnAPI = "0.1"
49+
LearnAPI = "1"
5050
MLJModelInterface = "1.11"
5151
Missings = "0.4, 1"
5252
OrderedCollections = "1.1"

src/resampling.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# TYPE ALIASES
1+
# TYPE ALIASES
22

33
const AbstractRow = Union{AbstractVector{<:Integer}, Colon}
44
const TrainTestPair = Tuple{AbstractRow,AbstractRow}
@@ -873,7 +873,7 @@ function _check_measure(measure, operation, model, y)
873873
end
874874

875875
model isa Deterministic &&
876-
StatisticalMeasuresBase.kind_of_proxy(measure) != LearnAPI.LiteralTarget() &&
876+
StatisticalMeasuresBase.kind_of_proxy(measure) != LearnAPI.Point() &&
877877
throw(ERR_MEASURES_DETERMINISTIC(measure))
878878

879879
return true
@@ -962,7 +962,7 @@ function _actual_operations(operation::Nothing,
962962
# trait. But it's values are instances of LearnAPI.KindOfProxy, instead of
963963
# symbols:
964964
#
965-
# `LearnAPI.LiteralTarget()` ~ `:deterministic` (`model isa Deterministic`)
965+
# `LearnAPI.Point()` ~ `:deterministic` (`model isa Deterministic`)
966966
# `LearnAPI.Distribution()` ~ `:probabilistic` (`model isa Deterministic`)
967967
#
968968
kind_of_proxy = StatisticalMeasuresBase.kind_of_proxy(m)
@@ -983,7 +983,7 @@ function _actual_operations(operation::Nothing,
983983
if MLJBase.prediction_type(model) === :probabilistic
984984
if kind_of_proxy === LearnAPI.Distribution()
985985
return predict
986-
elseif kind_of_proxy === LearnAPI.LiteralTarget()
986+
elseif kind_of_proxy === LearnAPI.Point()
987987
if observation_scitype <: Union{Missing,Finite}
988988
return predict_mode
989989
elseif observation_scitype <:Union{Missing,Infinite}
@@ -997,7 +997,7 @@ function _actual_operations(operation::Nothing,
997997
elseif MLJBase.prediction_type(model) === :deterministic
998998
if kind_of_proxy === LearnAPI.Distribution()
999999
throw(err_incompatible_prediction_types(model, m))
1000-
elseif kind_of_proxy === LearnAPI.LiteralTarget()
1000+
elseif kind_of_proxy === LearnAPI.Point()
10011001
return predict
10021002
else
10031003
throw(err_ambiguous_operation(model, m))

src/utilities.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,9 @@ generate_name!(model, existing_names; kwargs...) =
475475
476476
*Private method.*
477477
478-
Tries to infer the per-observation scitype from the scitype of `S`, when `S` is
479-
known to be the scitype of some container with multiple observations; here we
480-
view the scitype for one row of a table to be the scitype of the row converted
481-
to a vector. Return `Unknown` if unable to draw reliable inferrence.
482-
478+
Tries to infer the per-observation scitype from the scitype of `S`, when `S` is known to
479+
be the scitype of some container with multiple observations. Return `Unknown` if unable to
480+
draw reliable inferrence.
483481
484482
The observation scitype for a table is here understood as the scitype of a row
485483
converted to a vector.

0 commit comments

Comments
 (0)