Ejemplo n.º 1
0
# DEFINE SITE and VARIABLE #
#########################################
# site = "BlackSmithFork"
# site = "FranklinBasin"
# site = "MainStreet"
# site = "Mendon"
# site = "TonyGrove"
site = "WaterLab"
sensor = ['temp', 'cond', 'ph', 'do']
year = [2014, 2015, 2016, 2017, 2018, 2019]

# GET DATA #
#########################################
df_full, sensor_array = anomaly_utilities.get_data(site,
                                                   sensor,
                                                   year,
                                                   path="LRO_data/")
temp_df = sensor_array[sensor[0]]
cond_df = sensor_array[sensor[1]]
ph_df = sensor_array[sensor[2]]
do_df = sensor_array[sensor[3]]

# PARAMETER SELECTION #
#########################################
# Need to use an automated method to generalize getting p,d,q parameters
# These are the results of using auto.ARIMA to determine p,d,q parameters in R
sites = {
    'BlackSmithFork': 0,
    'FranklinBasin': 1,
    'MainStreet': 2,
    'Mendon': 3,
Ejemplo n.º 2
0
# site = "FranklinBasin"
# site = "MainStreet"
site = "Mendon"
# site = "TonyGrove"
# site = "WaterLab"
# sensor = "temp"
sensor = "cond"
# sensor = "ph"
# sensor = "do"
# sensor = "turb"
# sensor = "stage"
year = 2017

# Get data
df_full, df = anomaly_utilities.get_data(site,
                                         sensor,
                                         year,
                                         path="./LRO_data/")

matplotlib.pyplot.figure()
matplotlib.pyplot.plot(df['raw'], 'b', label='original data')
matplotlib.pyplot.legend()
matplotlib.pyplot.ylabel(sensor)
matplotlib.pyplot.show()

# Prophet .fit(df) requires columns ds (dates) and y
df['y'] = df['raw']
df['ds'] = df.index

m = Prophet(
    changepoint_range=1.0,
    n_changepoints=150,