Skip to content

Instantly share code, notes, and snippets.

View jpmallette's full-sized avatar

Jean-Philippe jpmallette

View GitHub Profile
@jpmallette
jpmallette / execute_cross_validation_and_performance_loop.py
Last active August 11, 2018 23:12
Execute Cross Validation and Performance Loop
def execute_cross_validation_and_performance_loop(cross_valid_params, metric = 'mse'):
""" Execute Cross Validation and Performance Loop
Parameters
----------
cross_valid_params: List of dict
dict value same as cross_validation function argument
model, horizon, period, initial
metric: string
sort the dataframe in ascending order base on the
@jpmallette
jpmallette / minimalist_parameter_grid_implementation.py
Last active August 16, 2018 11:22
minimalist Parameter Grid
from itertools import product
from fbprophet import Prophet
m = Prophet()
param_grid = {
'model' : [m]
, 'initial' : ['730 days','500 days']
, 'period' : ['180 days']
@jpmallette
jpmallette / example_parametergrid_with_sklearn.py
Last active August 16, 2018 11:45
ParameterGrid Class Example
# Create params grid object
from sklearn.model_selection import ParameterGrid
param_grid = {
'model' : [m]
, 'initial' : ['730 days','500 days']
, 'period' : ['180 days']
, 'horizon' : ['365 days']
}