PREDICT Class

class PREDICT.PREDICT(data, model, dateCol='date', startDate='min', endDate='max', timestep='week')

A class used to represent the PREDICT model.

data

The data to be used by the model.

Type:

pd.DataFrame

model

The model to be used for prediction.

Type:

PREDICTModel

dateCol

The column in the data that contains the date.

Type:

str

startDate

The start date for the prediction window.

Type:

str, dt.datetime

endDate

The end date for the prediction window.

Type:

str, pd.datetime

timestep

The timestep for the prediction window. Must be ‘week’, ‘day’, ‘month’, or an integer representing the number of days. Note: One month is considered 28 days.

Type:

str, int

currentWindowStart

The current start date of the prediction window.

Type:

pd.datetime

currentWindowEnd

The current end date of the prediction window.

Type:

pd.datetime

log

A dictionary to store logs.

Type:

dict

logHooks

A list of hooks to be called during logging.

Type:

list

addLog(key, date, val)

Adds a log entry to the log dictionary. :param key: The key for the log entry. :type key: str :param date: The date for the log entry. :type date: any :param val: The value for the log entry. :type val: any

addLogHook(hook)

Adds a hook to the logHooks list. :param hook: A function to be called during logging. :type hook: function

getLog()

Returns the log dictionary. :returns: The log dictionary. :rtype: dict

run()

Runs the prediction model over the specified date range.