in utils/lookout_equipment_utils.py [0:0]
def get_labels(self, labels_fname=None):
"""
Get the labelled ranges as provided to the model before training
PARAMS
======
labels_fname: string (Default to None)
As an option, if you provide a path to a CSV file containing
the label ranges, this method will use this file to load the
labels. If this argument is not provided, it will load the
labels from the trained model Describe API
RETURN
======
labelled_ranges: pandas.DataFrame
A Pandas dataframe with the labelled anomaly ranges listed in
chronological order with a Start and End columns
"""
if labels_fname is not None:
labels_df = pd.read_csv(labels_fname, header=None)
labels_df[0] = pd.to_datetime(labels_df[0])
labels_df[1] = pd.to_datetime(labels_df[1])
labels_df.columns = ['start', 'end']
self.labelled_ranges = labels_df
elif self.labelled_ranges is None:
self._load_model_response()
return self.labelled_ranges