The InputsGatherer class
- class inputs_gatherer.InputsGatherer(influxdb_client, forecast_type, cfg, logger, artificial_features)[source]
Bases:
objectClass handling the gathering of the inputs needed by a collection of predictors. There are 3 ways to create a dataframe:
Read an existing CSV (see method dataframe_reader)
Define a region composed of measurements and forecast stations, define the signals to be used by each station, then create all possible signals in JSON format and finally create the dataframe by querying InfluxDB (see method dataframe_builder_regions)
read an existing JSON containing a set of signals and create the dataframe by querying InfluxDB (see method dataframe_builder_custom)
- add_input_value(signal, forecast_substitution=False, force_substitution=False)[source]
Add the value related to a given input signal
- Parameters
signal (string) – signal code
- Returns
query
- Return type
string
- add_output_value(signal)[source]
Add the value related to a given output signal
- Parameters
signal (string) – signal code
- Returns
query
- Return type
string
- build_dataset(name, input_signals)[source]
Build the training dataset given a signal json file in folder “conf/dataset” either from a region or from a custom list
- calc_data(query, signal_data, func, forecast_substitution, str_steps, str_dt, force_substitution=False)[source]
- calc_yesterday_output_daily_values(region, os)[source]
Calc daily data of O3 values related to yesterday
- do_forecast_period_query(signal_data, measurement, forecast_substitution, force_substitution=False)[source]
- do_forecast_step_query(signal_data, measurement, forecast_substitution, force_substitution=False)[source]
- generate_input_signals_codes(region)[source]
Method to generate and save all known signals of a specific region (e.g. Ticino) with defined measuring and forecasting stations
- output_folder_creator(dataset_name)[source]
Get the address of the output folder for the current case