Esempio n. 1
0
def learn(city, station):
    # Get data from the past 30 days
    threshold = datetime.datetime.now() - datetime.timedelta(days=timespan)
    try:
        dataframe = query.station(city, station, threshold)
    except:
        return
    # Prepare the dataframe for learning
    dataframe = munging.prepare(dataframe)
    # Apply the regressor that is chosen in the settings
    method.fit(dataframe, 'bikes', city, station)
    method.fit(dataframe, 'spaces', city, station)