Beispiel #1
0
class Hyperparams(hyperparams.Hyperparams):
    d = hyperparams.Hyperparameter(
        default=0,
        description=
        'The reduced dimension of matrix factorization. It is usually smaller than the sizes of the matrix. When setting to 0, d will be automatically roughly estimated.',
        semantic_types=[
            'https://metadata.datadrivendiscovery.org/types/TuningParameter'
        ])
    tol = hyperparams.Hyperparameter(
        default=1e-5,
        description=
        'The tolerance of the relative changes of the variables in optimization. It will be utilized to check the convergence.',
        semantic_types=[
            'https://metadata.datadrivendiscovery.org/types/TuningParameter'
        ])
    maxiter = hyperparams.Hyperparameter(
        default=200,
        description='The maximum number of iterations.',
        semantic_types=[
            'https://metadata.datadrivendiscovery.org/types/TuningParameter'
        ])
    alpha = hyperparams.Hyperparameter(
        default=0.1,
        description=
        'The regularization parameter for the factorized dense matrix A.',
        semantic_types=[
            'https://metadata.datadrivendiscovery.org/types/TuningParameter'
        ])
Beispiel #2
0
class Hyperparams(hyperparams.Hyperparams):
    convert = hyperparams.Hyperparameter(
        default=True,
        description='Whether to convert non-numerical features to numerical.',
        semantic_types=[
            'https://metadata.datadrivendiscovery.org/types/ControlParameter'
        ])
    to_type = hyperparams.Hyperparameter(
        default=float,
        description='The data type we convert features to.',
        semantic_types=[
            'https://metadata.datadrivendiscovery.org/types/ControlParameter'
        ])
Beispiel #3
0
class Hyperparams(hyperparams.Hyperparams):
       period = hyperparams.Hyperparameter(default=1,semantic_types=[
        'https://metadata.datadrivendiscovery.org/types/TuningParameter',
    ],description="Window Size for decomposition")

       model = hyperparams.Hyperparameter(default='additive', semantic_types=[
           'https://metadata.datadrivendiscovery.org/types/ControlParameter',
       ], description="Window Size for decomposition")

       use_columns = hyperparams.Set(
           elements=hyperparams.Hyperparameter[int](-1),
           default=(),
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter'],
           description="A set of column indices to force primitive to operate on. If any specified column cannot be parsed, it is skipped.",
       )
       exclude_columns = hyperparams.Set(
           elements=hyperparams.Hyperparameter[int](-1),
           default=(),
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter'],
           description="A set of column indices to not operate on. Applicable only if \"use_columns\" is not provided.",
       )
       return_result = hyperparams.Enumeration(
           values=['append', 'replace', 'new'],
           default='append',
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter'],
           description="Should parsed columns be appended, should they replace original columns, or should only parsed columns be returned? This hyperparam is ignored if use_semantic_types is set to false.",
       )
       use_semantic_types = hyperparams.UniformBool(
           default=False,
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter'],
           description="Controls whether semantic_types metadata will be used for filtering columns in input dataframe. Setting this to false makes the code ignore return_result and will produce only the output dataframe"
       )
       add_index_columns = hyperparams.UniformBool(
           default=False,
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter'],
           description="Also include primary index columns if input data has them. Applicable only if \"return_result\" is set to \"new\".",
       )
       error_on_no_input = hyperparams.UniformBool(
           default=True,
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter'],
           description="Throw an exception if no input column is selected/provided. Defaults to true to behave like sklearn. To prevent pipelines from breaking set this to False.",
       )

       return_semantic_type = hyperparams.Enumeration[str](
           values=['https://metadata.datadrivendiscovery.org/types/Attribute',
                   'https://metadata.datadrivendiscovery.org/types/ConstructedAttribute'],
           default='https://metadata.datadrivendiscovery.org/types/Attribute',
           description='Decides what semantic type to attach to generated attributes',
           semantic_types=['https://metadata.datadrivendiscovery.org/types/ControlParameter']
       )
 class SubclassTestHyperparams(TestHyperparams):
     b = hyperparams.Hyperparameter(
         default=1,
         semantic_types=[
             'https://metadata.datadrivendiscovery.org/types/TuningParameter'
         ],
     )