def fit(dataframe, target, city, station): ''' Train the random forest to predict bikes or spaces. ''' X, Y = munging.split(dataframe, target) regressor = RandomForestRegressor(n_estimators=12, n_jobs=-1, max_depth=10) regressor.fit(X, Y) save_regressor(regressor, 'forest', target, city, station)
def fit(dataframe, target, city, station): ''' Train the decision tree to predict bikes or spaces. ''' X, Y = munging.split(dataframe, target) regressor = DecisionTreeRegressor() regressor.fit(X, Y) save_regressor(regressor, 'tree', target, city, station)