Skip to content

Commit 833e968

Browse files
authored
Merge pull request #997 from JuliaAI/update-compats-2025-03-25
Update some compats and dump Julia 1.6 support in favor of new LTS release
2 parents 0a82ccd + 73914cc commit 833e968

File tree

7 files changed

+33
-37
lines changed

7 files changed

+33
-37
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
version:
25-
- '1.6'
25+
- '1.10'
2626
- '1' # automatically expands to the latest stable 1.x release of Julia.
2727
os:
2828
- ubuntu-latest

Project.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MLJBase"
22
uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
33
authors = ["Anthony D. Blaom <[email protected]>"]
4-
version = "1.7.0"
4+
version = "1.7.1"
55

66
[deps]
77
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
@@ -26,7 +26,6 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
2626
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2727
ScientificTypes = "321657f4-b219-11e9-178b-2701a2544e81"
2828
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
29-
StatisticalMeasures = "a19d573c-0a75-4610-95b3-7071388c7541"
3029
StatisticalMeasuresBase = "c062fc1d-0d66-479b-b6ac-8b44719de4cc"
3130
StatisticalTraits = "64bff920-2084-43da-a3e6-9bb72801c0c9"
3231
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
@@ -46,7 +45,7 @@ ComputationalResources = "0.3"
4645
DelimitedFiles = "1"
4746
Distributions = "0.25.3"
4847
InvertedIndices = "1"
49-
LearnAPI = "0.1"
48+
LearnAPI = "1"
5049
MLJModelInterface = "1.11"
5150
Missings = "0.4, 1"
5251
OrderedCollections = "1.1"
@@ -56,13 +55,13 @@ ProgressMeter = "1.7.1"
5655
RecipesBase = "1"
5756
Reexport = "1.2"
5857
ScientificTypes = "3"
59-
StatisticalMeasures = "0.1.1"
58+
StatisticalMeasures = "0.2"
6059
StatisticalMeasuresBase = "0.1.1"
6160
StatisticalTraits = "3.4"
6261
Statistics = "1"
6362
StatsBase = "0.32, 0.33, 0.34"
6463
Tables = "0.2, 1.0"
65-
julia = "1.6"
64+
julia = "1.10"
6665

6766
[extras]
6867
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"

src/MLJBase.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,4 @@ export default_measure
310310
export pdf, sampler, mode, median, mean, shuffle!, categorical, shuffle,
311311
levels, levels!, std, Not, support, logpdf, LittleDict
312312

313-
# for julia < 1.9
314-
if !isdefined(Base, :get_extension)
315-
include(joinpath("..","ext", "DefaultMeasuresExt.jl"))
316-
@reexport using .DefaultMeasuresExt.StatisticalMeasures
317-
end
318-
319313
end # module

src/hyperparam/one_dimensional_ranges.jl

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ERROR_AMBIGUOUS_UNION = ArgumentError(
8888
" in the example, `range(Int, :dummy, lower=1, upper=10)`.")
8989

9090
"""
91-
r = range(model, :hyper; values=nothing)
91+
r = range(model, :hyper; values=...)
9292
9393
Define a one-dimensional `NominalRange` object for a field `hyper` of
9494
`model`. Note that `r` is not directly iterable but `iterator(r)` is.
@@ -97,19 +97,14 @@ A nested hyperparameter is specified using dot notation. For example,
9797
`:(atom.max_depth)` specifies the `max_depth` hyperparameter of
9898
the submodel `model.atom`.
9999
100-
r = range(model, :hyper; upper=nothing, lower=nothing,
101-
scale=nothing, values=nothing)
100+
r = range(model, :hyper; upper=..., lower..., unit=..., origin=...,
101+
scale=nothing)
102102
103-
Assuming `values` is not specified, define a one-dimensional
104-
`NumericRange` object for a `Real` field `hyper` of `model`. Note
105-
that `r` is not directly iteratable but `iterator(r, n)`is an iterator
106-
of length `n`. To generate random elements from `r`, instead apply
107-
`rand` methods to `sampler(r)`. The supported scales are `:linear`,`
108-
:log`, `:logminus`, `:log10`, `:log10minus`, `:log2`, or a callable
109-
object.
110-
111-
Note that `r` is not directly iterable, but `iterator(r, n)` is, for
112-
given resolution (length) `n`.
103+
Define a one-dimensional `NumericRange` object for a `Real` property `hyper` of `model`.
104+
Note that `r` is not directly iteratable but `iterator(r, n)`is an iterator of length
105+
`n`. To generate random elements from `r`, instead apply `rand` methods to
106+
`sampler(r)`. The supported scales are `:linear`,` :log`, `:logminus`, `:log10`,
107+
`:log10minus`, `:log2`, or a callable object.
113108
114109
By default, the behaviour of the constructed object depends on the
115110
type of the value of the hyperparameter `:hyper` at `model` *at the
@@ -119,12 +114,22 @@ behaviour is determined by the value of the specified type.
119114
120115
A nested hyperparameter is specified using dot notation (see above).
121116
117+
# keyword options
118+
122119
If `scale` is unspecified, it is set to `:linear`, `:log`,
123120
`:log10minus`, or `:linear`, according to whether the interval
124121
`(lower, upper)` is bounded, right-unbounded, left-unbounded, or
125122
doubly unbounded, respectively. Note `upper=Inf` and `lower=-Inf` are
126123
allowed.
127124
125+
You must specify at least two of the keyword arguments `upper`, `lower`, `unit` and
126+
`origin`. The last two parameters are used when fitting some distributions to
127+
unbounded `NumericRange` objects. See [`Distributions.fit`](@ref) for details.
128+
129+
A range is *unbounded* if `lower=-Inf` or `upper=Inf`, or one of these is left
130+
unspecified. In this case, both `unit` and `origin` must be specified. In the bounded
131+
case, these have the radius and midpoint of `[lower, upper]` as fallbacks.
132+
128133
If `values` is specified, the other keyword arguments are ignored and
129134
a `NominalRange` object is returned (see above).
130135

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.

test/resampling.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dummy_measure_det(yhat, y) = 42
3131
API.@trait(
3232
typeof(dummy_measure_det),
3333
observation_scitype = MLJBase.Textual,
34-
kind_of_proxy = LearnAPI.LiteralTarget(),
34+
kind_of_proxy = LearnAPI.Point(),
3535
)
3636

3737
dummy_measure_interval(yhat, y) = 42
@@ -256,7 +256,7 @@ end
256256
@everywhere begin
257257
user_rms(yhat, y) = mean((yhat -y).^2) |> sqrt
258258
# deliberately omitting `consumes_multiple_observations` trait:
259-
API.@trait typeof(user_rms) kind_of_proxy=LearnAPI.LiteralTarget()
259+
API.@trait typeof(user_rms) kind_of_proxy=LearnAPI.Point()
260260
end
261261

262262
@testset_accelerated "folds specified" accel begin

0 commit comments

Comments
 (0)