Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class Type(object):
"""Hyperparameter types."""
INT = "int"
INT_EXP = "int_exp"
INT_CAT = "int_cat"
FLOAT = "float"
FLOAT_EXP = "float_exp"
FLOAT_CAT = "float_cat"
STRING = "string"
BOOL = "bool"
_CATEGORICAL_TYPES = (Type.STRING, Type.BOOL, Type.INT_CAT, Type.FLOAT_CAT)
_INTEGER_TYPES = (Type.INT, Type.INT_EXP)
_FLOAT_TYPES = (Type.FLOAT, Type.FLOAT_EXP)
class MLHyperparam(object):
"""A Hyperparameter that the DeepMining system can act on.
Should belong to a MLBLock.
Attributes:
param_name: The name of this hyperparameter.
block_name: The name of the MLBLock this hyperparameter belongs
to.
param_type: The type of this hyperparameter. See the Type object
in this module for possible types.
param_range: A list of the form [a, b] such that the value of
this hyperparameter is between a and b inclusive. If this
import random
class Type(object):
"""Hyperparameter types."""
INT = "int"
INT_EXP = "int_exp"
INT_CAT = "int_cat"
FLOAT = "float"
FLOAT_EXP = "float_exp"
FLOAT_CAT = "float_cat"
STRING = "string"
BOOL = "bool"
_CATEGORICAL_TYPES = (Type.STRING, Type.BOOL, Type.INT_CAT, Type.FLOAT_CAT)
_INTEGER_TYPES = (Type.INT, Type.INT_EXP)
_FLOAT_TYPES = (Type.FLOAT, Type.FLOAT_EXP)
class MLHyperparam(object):
"""A Hyperparameter that the DeepMining system can act on.
Should belong to a MLBLock.
Attributes:
param_name: The name of this hyperparameter.
block_name: The name of the MLBLock this hyperparameter belongs
to.
param_type: The type of this hyperparameter. See the Type object
in this module for possible types.
param_range: A list of the form [a, b] such that the value of
class Type(object):
"""Hyperparameter types."""
INT = "int"
INT_EXP = "int_exp"
INT_CAT = "int_cat"
FLOAT = "float"
FLOAT_EXP = "float_exp"
FLOAT_CAT = "float_cat"
STRING = "string"
BOOL = "bool"
_CATEGORICAL_TYPES = (Type.STRING, Type.BOOL, Type.INT_CAT, Type.FLOAT_CAT)
_INTEGER_TYPES = (Type.INT, Type.INT_EXP)
_FLOAT_TYPES = (Type.FLOAT, Type.FLOAT_EXP)
class MLHyperparam(object):
"""A Hyperparameter that the DeepMining system can act on.
Should belong to a MLBLock.
Attributes:
param_name: The name of this hyperparameter.
block_name: The name of the MLBLock this hyperparameter belongs
to.
param_type: The type of this hyperparameter. See the Type object
in this module for possible types.
param_range: A list of the form [a, b] such that the value of
this hyperparameter is between a and b inclusive. If this
hyperparameter is categorical, this is a list containing all