streamlit_src.models package

Submodules

streamlit_src.models.air_quality_model module

class streamlit_src.models.air_quality_model.AirQualityModel[source]

Bases: object

A class that loads the air quality model and makes predictions.

The model is loaded from a pickle file located at PREDICTION_PATH.

_WHO_NO2_LEVEL

The WHO air quality level for NO2 in micrograms per cubic meter.

Type:

int

_WHO_O3_LEVEL

The WHO air quality level for O3 in micrograms per cubic meter.

Type:

int

calculate_metrics() DataFrame[source]

Calculates the root mean squared error for the predictions of the last three days.

The data is obtained from a CSV file located at PREDICTION_PATH.

Returns:

A pandas DataFrame with the root mean squared error for the predictions of the last three days.

Return type:

pd.DataFrame

get_all_data_last_three_days() DataFrame[source]

Returns all the air quality data for the last three days from the past 3 days data.

The data is obtained from a CSV file located at PAST_DATA_PATH.

Returns:

A pandas DataFrame with the air quality data for the last three days.

Return type:

pd.DataFrame

get_last_three_days() DataFrame[source]

Returns all the air quality data for the last three days from the past 3 days data.

The data is obtained from a CSV file located at PAST_DATA_PATH.

Returns:

A pandas DataFrame with the air quality data for the last three days.

Return type:

pd.DataFrame

get_today_data() Series[source]

Returns the air quality data for today from the past 3 days data.

The data is obtained from a CSV file located at PAST_DATA_PATH.

Returns:

A pandas Series with the air quality data for today.

Return type:

pd.Series

next_three_day_predictions() DataFrame[source]

Returns the predictions for the next three days.

Module contents