Comments (6)
Okay, I'm planning to implement this soon. Below is the doc-string for the implementation I am proposing. (Yes, it could be more user-friendly.) Feedback on the proposal very welcome. I plan to start this early next week (16/17 March).
Context:
-
Tuning section of user manual including doc strings for
TunedModel
(the user's main interface point for scheduling tuning),range
,sampler
(for wrapping ranges as samplers) andfit(::Univariate, ::ParamRange)
(for fitting distributions to a range).
Proposed doc-string for random search tuning strategy
RandomSearch(bounded=Distributions.Uniform,
positive_unbounded=Distributions.Gamma,
others=Normal,
rng=Random.GLOBAL_RNG)
Instantiate a random search tuning strategy for searching over
Cartesian hyperparameter domains.
Supported ranges:
-
A single one-dimensional range (
ParamRange
object)r
, or a pair
of the form(r, d)
, whered
is a probability vector of the same
length asr.values
, ifr
is aNominalRange
, and is otherwise:
(i) anyDistributions.Univariate
instance; or (ii) one of the
subtypes ofDistributions.Univariate
listed in the table below,
for automatic fitting usingDistributions.fit(d, r)
. -
Any vector of objects of the above form
distribution types | for fitting to ranges of this type |
---|---|
Arcsine , Uniform , Biweight , Cosine , Epanechnikov , SymTriangularDist , Triweight |
bounded |
Gamma , InverseGaussian , Poisson |
positive |
Normal , Logistic , LogNormal , Cauchy , Gumbel , Laplace |
any |
ParamRange
objects are constructed using the range
method.
Example range 1:
range(model, :hyper1, lower=1, origin=2, unit=1)
Example range 2:
[(range(model, :hyper1, lower=1, upper=10), Arcsine),
range(model, :hyper2, lower=2, upper=4),
(range(model, :hyper2, lower=2, upper=4), Normal(0, 3)),
range(model, :hyper3, values=[:ball, :tree], [0.3, 0.7])]
Note: All the field
values of the ParamRange
objects (:hyper1
,
:hyper2
, :hyper3
in the preceding example) must refer to field
names a of single model (the model
specified during TunedModel
construction).
Algorithm
Models for evaulation are generated by sampling each range r
using
rng(s)
where, s = sampler(r, d)
. See sampler
for details. If d
is not specified, then sampling is uniform (with replacement) in the
case of a NominalRange
, and is otherwise given by the defaults
specified by the tuning strategy parameters bounded
,
positive_unbounded
, and other
, depending on the NumericRange
type.
See also TunedModel
, range
, sampler
.
from mlj.jl.
would it be worth writing up the design for tuning strategies?
You mention a "best" method next to the obvious "fit/predict".
However, should the best strategy (as per tuning) not be queriable via a "fitted model" interface which has these as parameters? E.g., in a the same (interface) way as you would query coefficients and CI of a linear model.
from mlj.jl.
Good point.
The "best strategy" is indeed implemented via a "fitted model" interface, as shown in the README.md. The best
method doesn't compute anything, it just retrieves the model (i.e. hyper parameters) that the fitting (=tuning) process determined (and used for fitting the final model to all available data).
If a user wants details about a fit-result (e.g., coefficients of a linear model), then he would seek these in the report
field of the corresponding machine. I could do the same here and drop best
, no problem.
from mlj.jl.
As to writing up design for genetic algorithm: Good idea. Do we have any volunteers?
from mlj.jl.
this sounds fantastic. I'm a bit confused by your example, shouldn't the third one be a bounded distr? or do you automatically truncate over the range?
I also wonder a few things:
- whether you could do extend the current syntax to pass a distribution or a sampler where a sampler is anything that can be queried and could be user defined
- in light of (1) whether you could pass the history ("context") to the sampler
- at the moment, unless I misunderstand something, it seems you would sample equally in all dimensions (one configuration = one sample per each HP) this makes sense however I could see interest in sampling more along specific dimensions in which case you may want to pass a number of samples?
Apologies if theses questions are poorly formulated and great work as always
from mlj.jl.
@tlienart Thanks for that!
I'm a bit confused by your example, shouldn't the third one be a bounded distr? or do you automatically truncate over the range?
Yes, sampler(r, d)
always creates a sampler truncated to the range, but this should be made explicit in the current docstring, thanks.
- whether you could do extend the current syntax to pass a distribution or a sampler where a sampler is anything that can be queried and could be user defined
So, instead of passing r
or (r, d)
I pass (:lambda, s)
, where s
is any sampler? Sounds like a good idea!
- in light of (1) whether you could pass the history ("context") to the sampler
Also sounds like a nice idea but a non-trivial API complication. How would the interface for passing context to a sampler look like?
- at the moment, unless I misunderstand something, it seems you would sample equally in all dimensions (one configuration = one sample per each HP) this makes sense however I could see interest in sampling more along specific dimensions in which case you may want to pass a number of samples?
I'm not sure I understand the proposal. Are you suggesting that some hyper parameters be sampled less often (ie are kept fixed while others change?). Can you explain a situation where this might be beneficial? (Assuming here that we are not leaving the realm of ordinary random sampling which does not consider history of previous evaluations.) What do you mean by "pass a number of samples"? Or do you mean samplers? Could you give me a little more detail?
from mlj.jl.
Related Issues (20)
- SymbolicRegression.jl — registry update HOT 2
- Is the Averager documentation deprecated? HOT 2
- Update deprecated document example in "Transformers ..." section of manual
- `fit!` not exported in 0.19.3/0.19.4? HOT 2
- is there support for segmented or nested models? HOT 1
- Doc generation is failing silently HOT 2
- A de-correlation model for feature exclusion HOT 1
- [Tracking] Migration of measures MLJBase.jl -> StatisticalMeasures.jl HOT 1
- Add more examples of exported learning networks
- Confusing Julia code in adding_models_for_general_use.md HOT 1
- Include MLJBalancing.jl in MLJ and re-export it's names.
- Update docs for new class imbalance support
- Add new sk-learn models to the docs
- Export the name `MLJFlow` HOT 1
- `evaluate` errors HOT 3
- Add AutoEncoderMLJ model (part of BetaML) HOT 10
- need a tutorial for using logger with dagshub and mlflow HOT 4
- Document how to add plot recipes in a new model implementation HOT 4
- Add new model descriptors to fix doc-generation fail HOT 1
- Two models fail integration tests but defy isolation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlj.jl.