From bfa75122738fc418f7078ef9035a814d6b7e5804 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 7 Mar 2020 06:58:58 +1300 Subject: [PATCH 1/5] update readme to reference ParamRange `sampler` --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0c3f0f8..c0216c5 100644 --- a/README.md +++ b/README.md @@ -285,8 +285,8 @@ tuning strategy should like to handle, and the tuning strategy functions to be implemented are dispatched on these types. Here are the range objects supported by `Grid`: - - one-dimensional `NumericRange` or `NominalRange` objects (these - types are provided by MLJBase) + - one-dimensional `NumericRange` or `NominalRange` objects (of + abstract type `ParamRange`) provided by MLJBase. - a tuple `(p, r)` where `p` is one of the above range objects, and `r` a resolution to override the default `resolution` of the @@ -311,6 +311,12 @@ hyperparameter (a field of the prototype in the context of tuning) which is recorded in its `field` attribute, but for composite models this might be a be a "nested name", such as `:(atom.max_depth)`. +Both `NumericRange` and `NominalRange` are constructed with the +`MLJBase` extension to the `range` function. Use the `iterator` and +`sampler` methods to convert ranges into one-dimensional grids or for +random sampling, respectively. See the docstrings or `range`, +`iterator` and `sampler` for details. + #### The `result` method: For declaring what parts of an evaluation goes into the history From e80a2c71697703aff399a659e99a0c066773c05b Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 7 Mar 2020 07:01:09 +1300 Subject: [PATCH 2/5] tweak readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c0216c5..b52fd2b 100644 --- a/README.md +++ b/README.md @@ -314,8 +314,7 @@ this might be a be a "nested name", such as `:(atom.max_depth)`. Both `NumericRange` and `NominalRange` are constructed with the `MLJBase` extension to the `range` function. Use the `iterator` and `sampler` methods to convert ranges into one-dimensional grids or for -random sampling, respectively. See the docstrings or `range`, -`iterator` and `sampler` for details. +random sampling, respectively. See the docstrings for details. #### The `result` method: For declaring what parts of an evaluation goes into the history From 2580cbb67744fd330d9ba3c85012045a1d3db479 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Sat, 7 Mar 2020 07:08:25 +1300 Subject: [PATCH 3/5] tweak again --- README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b52fd2b..e97edd5 100644 --- a/README.md +++ b/README.md @@ -296,26 +296,25 @@ the range objects supported by `Grid`: where `r1` and `r2` are `NumericRange` objects and `r3` a `NominalRange` object. +Both `NumericRange` and `NominalRange` are constructed with the +`MLJBase` extension to the `range` function. Use the `iterator` and +`sampler` methods to convert ranges into one-dimensional grids or for +random sampling, respectively. See the docstrings for details. + Recall that `NominalRange` has a `values` field, while `NumericRange` has the fields `upper`, `lower`, `scale`, `unit` and `origin`. The `unit` field specifies a preferred length scale, while `origin` a preferred "central value". These default to `(upper - lower)/2` and `(upper + lower)/2`, respectively, in the bounded case (neither `upper = Inf` nor `lower = -Inf`). The fields `origin` and `unit` are used in -generating grids for unbounded ranges (and could be used in other -strategies - for fitting two-parameter probability distributions, for -example). +generating grids or fitting probability distributions to unbounded +ranges. A `ParamRange` object is always associated with the name of a hyperparameter (a field of the prototype in the context of tuning) which is recorded in its `field` attribute, but for composite models this might be a be a "nested name", such as `:(atom.max_depth)`. -Both `NumericRange` and `NominalRange` are constructed with the -`MLJBase` extension to the `range` function. Use the `iterator` and -`sampler` methods to convert ranges into one-dimensional grids or for -random sampling, respectively. See the docstrings for details. - #### The `result` method: For declaring what parts of an evaluation goes into the history From 8b4e7f7d9874556b4af5754adca638871d45cf4b Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Wed, 11 Mar 2020 14:41:26 +1300 Subject: [PATCH 4/5] rm extension to iterator method now MLJBase --- src/ranges.jl | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/ranges.jl b/src/ranges.jl index f7f3ecd..37e375d 100644 --- a/src/ranges.jl +++ b/src/ranges.jl @@ -1,6 +1,3 @@ -# TODO: move this next line to MLJBase: -MLJBase.iterator(r::NominalRange, ::Nothing) = iterator(r) - """ MLJTuning.grid([rng, ] prototype, ranges, resolutions) From e0a3f606e25629ae7fbb671ba8acb15cdcfc7cf5 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Wed, 11 Mar 2020 17:25:53 +1300 Subject: [PATCH 5/5] bump to 0.2.0 and bump [compat] MLJBase = "^0.12" --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index e308a77..9b7d212 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJTuning" uuid = "03970b2e-30c4-11ea-3135-d1576263f10f" authors = ["Anthony D. Blaom "] -version = "0.1.4" +version = "0.2.0" [deps] ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3" @@ -12,7 +12,7 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" [compat] ComputationalResources = "^0.3" -MLJBase = "^0.11" +MLJBase = "^0.12" RecipesBase = "^0.8" julia = "^1"