public abstract static class HyperSpaceWalker.BaseWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria> extends java.lang.Object implements HyperSpaceWalker<MP,C>
The external Grid / Hyperparameter search API uses a HashMap
Modifier and Type | Class and Description |
---|---|
static class |
HyperSpaceWalker.BaseWalker.WalkerFactory<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
Java hackery so we can have a factory method on a class with type params.
|
HyperSpaceWalker.BaseWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>, HyperSpaceWalker.CartesianWalker<MP extends Model.Parameters>, HyperSpaceWalker.HyperSpaceIterator<MP extends Model.Parameters>, HyperSpaceWalker.RandomDiscreteValueWalker<MP extends Model.Parameters>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String[] |
_hyperParamNames
Cached names of used hyper parameters.
|
protected java.lang.String[] |
_hyperParamNamesSubspace |
protected java.util.Map<java.lang.String,java.lang.Object[]> |
_hyperParams
Hyper space description - in this case only dimension and possible values.
|
protected java.util.Map<java.lang.String,java.lang.Object[]>[] |
_hyperParamSubspaces |
protected long |
_maxHyperSpaceSize
Compute max size of hyper space to walk.
|
protected C |
_search_criteria |
static java.lang.String |
SUBSPACES |
Constructor and Description |
---|
BaseWalker(MP params,
java.util.Map<java.lang.String,java.lang.Object[]> hyperParams,
ModelParametersBuilderFactory<MP> paramsBuilderFactory,
C search_criteria) |
Modifier and Type | Method and Description |
---|---|
protected long |
computeMaxSizeOfHyperSpace() |
java.lang.String[] |
getAllHyperParamNamesInSubspaces() |
java.lang.String[] |
getHyperParamNames()
Returns hyper parameters names which are used for walking the hyper parameters space.
|
java.util.Map<java.lang.String,java.lang.Object[]> |
getHyperParams() |
long |
getMaxHyperSpaceSize()
Return estimated maximum size of hyperspace, not subject to any early stopping criteria.
|
protected MP |
getModelParams(MP params,
java.lang.Object[] hyperParams,
java.lang.String[] hyperParamNames) |
ModelParametersBuilderFactory<MP> |
getParametersBuilderFactory() |
MP |
getParams()
Return initial model parameters for search.
|
protected java.lang.Object[] |
hypers(java.util.Map<java.lang.String,java.lang.Object[]> hyperParams,
java.lang.String[] hyperParamNames,
int[] hidx)
Given a list of indices for the hyperparameter values return an Object[] of the actual values.
|
protected int |
integerHash(java.util.Map<java.lang.String,java.lang.Object[]> hyperParams,
java.lang.String[] hyperParamNames,
int[] ar,
int subspaceNum) |
protected java.util.Map<java.lang.String,java.lang.Object[]> |
mergeHashMaps(java.util.Map<java.lang.String,java.lang.Object[]> hyperparams,
java.util.Map<java.lang.String,java.lang.Object[]> subspace) |
C |
search_criteria()
Search criteria for the hyperparameter search including directives for how to search and
when to stop the search.
|
boolean |
stopEarly(Model model,
ScoringInfo[] sk)
Based on the last model, the given array of ScoringInfo, and our stopping criteria should we stop early?
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
estimateGridWork, getAllHyperParamNames, iterator
protected final C extends HyperSpaceSearchCriteria _search_criteria
search_criteria()
public static final java.lang.String SUBSPACES
protected final java.util.Map<java.lang.String,java.lang.Object[]> _hyperParams
protected final java.lang.String[] _hyperParamNames
protected final java.lang.String[] _hyperParamNamesSubspace
protected java.util.Map<java.lang.String,java.lang.Object[]>[] _hyperParamSubspaces
protected final long _maxHyperSpaceSize
public BaseWalker(MP params, java.util.Map<java.lang.String,java.lang.Object[]> hyperParams, ModelParametersBuilderFactory<MP> paramsBuilderFactory, C search_criteria)
paramsBuilderFactory
- hyperParams
- public C search_criteria()
search_criteria
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public boolean stopEarly(Model model, ScoringInfo[] sk)
stopEarly
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public java.lang.String[] getHyperParamNames()
HyperSpaceWalker
getHyperParamNames
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public java.lang.String[] getAllHyperParamNamesInSubspaces()
getAllHyperParamNamesInSubspaces
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public java.util.Map<java.lang.String,java.lang.Object[]> getHyperParams()
getHyperParams
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public long getMaxHyperSpaceSize()
HyperSpaceWalker
getMaxHyperSpaceSize
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public MP getParams()
HyperSpaceWalker
getParams
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
public ModelParametersBuilderFactory<MP> getParametersBuilderFactory()
getParametersBuilderFactory
in interface HyperSpaceWalker<MP extends Model.Parameters,C extends HyperSpaceSearchCriteria>
protected MP getModelParams(MP params, java.lang.Object[] hyperParams, java.lang.String[] hyperParamNames)
protected long computeMaxSizeOfHyperSpace()
protected java.util.Map<java.lang.String,java.lang.Object[]> mergeHashMaps(java.util.Map<java.lang.String,java.lang.Object[]> hyperparams, java.util.Map<java.lang.String,java.lang.Object[]> subspace)
protected java.lang.Object[] hypers(java.util.Map<java.lang.String,java.lang.Object[]> hyperParams, java.lang.String[] hyperParamNames, int[] hidx)
protected int integerHash(java.util.Map<java.lang.String,java.lang.Object[]> hyperParams, java.lang.String[] hyperParamNames, int[] ar, int subspaceNum)