madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iyerr3 <...@git.apache.org>
Subject [GitHub] incubator-madlib pull request: SVM: Add cross validation support a...
Date Tue, 24 Nov 2015 22:49:27 GMT
Github user iyerr3 commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/4#discussion_r45806765
  
    --- Diff: src/ports/postgres/modules/svm/svm.py_in ---
    @@ -440,55 +595,68 @@ def _process_epsilon(is_svc, args):
     def _extract_params(schema_madlib, params, module='SVM'):
         # NOTICE: the type of values in params_default should be consistent with
         # the types specified in params_types
    -    params_default = {'init_stepsize': 0.01,
    -                      'decay_factor': 0.9,
    -                      'max_iter': 100,
    -                      'tolerance': 1e-10,
    -                      'lambda': 1.0,
    -                      'norm': 'L2',
    -                      'n_folds': 0,
    -                      'epsilon': 0.01,
    -                      'eps_table': ''}
    -
    -    params_types = {'init_stepsize': float,
    -                    'decay_factor': float,
    -                    'max_iter': int,
    -                    'tolerance': float,
    -                    'lambda': list,
    -                    'norm': str,
    -                    'n_folds': int,
    -                    'epsilon': float,
    -                    'eps_table': str}
    +    params_default = {
    +                        'init_stepsize': [0.01],
    +                        'decay_factor': [0.9],
    +                        'max_iter': [100],
    +                        'tolerance': 1e-10,
    +                        'lambda': [0.01],
    +                        'norm': 'L2',
    +                        'n_folds': 0,
    +                        'validation_result': '',
    +                        'epsilon': [0.01],
    +                        'eps_table': ''}
    +
    +    params_types = {
    +                        'init_stepsize': list,
    +                        'decay_factor': list,
    +                        'max_iter': list,
    +                        'tolerance': float,
    +                        'lambda': list,
    +                        'norm': str,
    +                        'n_folds': int,
    +                        'validation_result': str,
    +                        'epsilon': list,
    +                        'eps_table': str}
     
         params_vals = extract_keyvalue_params(params,
                                               params_types,
                                               params_default)
    -
         if params_vals['n_folds'] < 0:
    --- End diff --
    
    let's use the `_assert` format to maintain consistency. I would like to add another PR
to change all `_assert` to `assert_`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message