Skip to content

Conversation

ngupta23
Copy link
Collaborator

Describe the changes you've made

Added tune_model capability along with updates for create model

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, local variables)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Unit tests have been added

Describe if there is any unusual behaviour of your code(Write NA if there isn't)

NA

Checklist:

  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

@ngupta23 ngupta23 requested review from Yard1 and TremaMiguel March 17, 2021 10:23
Copy link
Member

@Yard1 Yard1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just have one suggestion that will simplify the code by a fair bit :)

self.logger.info("Defining Hyperparameters")

# TODO: Replace with time series specific code
def total_combintaions_in_grid(grid):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use ParameterGrid from sklearn for getting the combinations, I believe it'd be the easiest way: https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.ParameterGrid.html - and it will allow for easy random search too

Copy link
Collaborator Author

@ngupta23 ngupta23 Mar 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Yard1 , That is what I am using though I am not sure it has methods to compute number of combinations.

evaluate_candidates(ParameterGrid(self.param_grid))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it supports len. If not you should be able to calculate the number of possible combinations using some math, we probably don't need loops here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

error_score=error_score)
for train, test in get_folds(cv, y))
# raise key exceptions
except (TerminatedWorkerError, KeyboardInterrupt, SystemExit):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just wondering if an Out of Memory Error could also happen ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it could. We can add them as we encounter them. What do you think?

@Yard1 Yard1 merged commit 4e655ee into time_series Mar 20, 2021
@ngupta23 ngupta23 deleted the ts_tune_model branch March 20, 2021 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants