def svr_linear_config():
    return {
        'kernel': ('linear',),
        'tol': (0.001,),    # TODO add relevant range
        'C': (1.0,),        # ditto
        'epsilon': (0.1,),  # ditto
        'shrinking': (True, False),
        'max_iter': (-1,),  # TODO add relevant range
    }

"""
Explanation: Regression configurations
TODO

add relevant ranges
set proper types for default configuration
find solution for string/float type in numpy

To change configurations, redefine values for respective keys in given dictionary. Any iterable with len() function is accepted, values returned should match type specified in defaults.
TOC

SVR
Generator
Defaults
Configs
Linear
Polynomial
Radial basis
Sigmoid





SVR<a id='svr'></a>
TODO

add precomputed kernels?
End of explanation
"""


def svr_poly_config():
    return {
        'kernel': ('poly',),
        'degree': (3,),     # TODO add relevant range
        'gamma': ('auto',), # ditto
        'coef0': (0.0,),    # ditto
        'tol': (0.001,),    # ditto
        'C': (1.0,),
        'epsilon': (0.1,),
        'shrinking': (True, False),
        'max_iter': (-1,),  # TODO add relevant range
    }

"""
Explanation: <a id='svr_poly'></a>
End of explanation
"""


def svr_rbf_config():
    return {
        'kernel': ('rbf',),
        'gamma': ('auto',), # TODO add relevant range
        'tol': (0.001,),    # ditto
        'C': (1.0,),
        'epsilon': (0.1,),
        'shrinking': (True, False),
        'max_iter': (-1,),  # TODO add relevant range
    }

"""
Explanation: <a id='svr_rbf'></a>
End of explanation
"""


def svr_sigmoid_config():
    return {
        'kernel': ('sigmoid',),
        'gamma': ('auto',), # TODO add relevant range
        'coef0': (0.0,),    # ditto
        'tol': (0.001,),    # ditto
        'C': (1.0,),
        'epsilon': (0.1,),
        'shrinking': (True, False),
        'max_iter': (-1,),  # TODO add relevant range
    }

"""
Explanation: <a id='svr_sigmoid'></a>
End of explanation
"""


import modules.utils as utils

svr_defaults = [('kernel', 'S10', 'rbf'),
                ('degree', 'i4', 3),
                ('gamma', 'S5', 'auto'),  # TODO auto or float
                ('coef0', 'f4', 0.0),
                ('tol', 'f4', 0.001),
                ('C', 'f4', 1.0),
                ('epsilon', 'f4', 0.1),
                ('shrinking', '?', True),
                ('cache_size', 'f4', 200),
                ('verbose', '?', False),
                ('max_iter', 'i4', -1)]

svr_configs = (svr_linear_config(),
               svr_poly_config(),
               svr_rbf_config(),
               svr_sigmoid_config())

"""
Explanation: SVR defaults<a id='svr_defaults'></a>
End of explanation
"""


import modules.utils as utils
import modules.values as values

utils.generate_parameters(values.parameters_path + 'svr', svr_configs, svr_defaults)

"""
Explanation: SVR generator<a id='svr_gen'></a>
End of explanation
"""


