tech.v3.ml.gridsearch

Gridsearching as defined by create a map with gridsearch definitions for its values and then gridsearching which produces a sequence of full defined maps.

The initial default implementation uses the sobol sequence.

categorical

(categorical value-vec)

Given a vector a categorical values create a gridsearch definition.

linear

(linear start end n-steps res-dtype-or-space)(linear start end n-steps)(linear start end)

Create a gridsearch definition which does a linear search.

  • res-dtype-or-space map be either a datatype keyword or a vector of categorical values.

sobol-gridsearch

(sobol-gridsearch opt-map start-idx)(sobol-gridsearch opt-map)

Given an map of key->values where some of the values are gridsearch definitions produce a sequence of fully defined maps.

user> (require '[tech.v3.ml.gridsearch :as ml-gs])
nil
user> (def opt-map  {:a (ml-gs/categorical [:a :b :c])
                     :b (ml-gs/linear 0.01 1 10)
                     :c :not-searched})
user> opt-map
{:a
 {:tech.v3.ml.gridsearch/type :linear,
  :start 0.0,
  :end 2.0,
  :n-steps 3,
  :result-space [:a :b :c]}
  ...

user> (ml-gs/sobol-gridsearch opt-map)
({:a :b, :b 0.56, :c :not-searched}
 {:a :c, :b 0.22999999999999998, :c :not-searched}
 {:a :b, :b 0.78, :c :not-searched}
...