|
|
@ -101,8 +101,10 @@ class DropModel(Model): |
|
|
|
def do_predict(self, dataframe: pd.DataFrame): |
|
|
|
def do_predict(self, dataframe: pd.DataFrame): |
|
|
|
data = dataframe['value'] |
|
|
|
data = dataframe['value'] |
|
|
|
possible_drops = utils.find_drop(data, self.state['DROP_HEIGHT'], self.state['DROP_LENGTH'] + 1) |
|
|
|
possible_drops = utils.find_drop(data, self.state['DROP_HEIGHT'], self.state['DROP_LENGTH'] + 1) |
|
|
|
|
|
|
|
|
|
|
|
filtered = self.__filter_prediction(possible_drops, data) |
|
|
|
filtered = self.__filter_prediction(possible_drops, data) |
|
|
|
return [(dataframe['timestamp'][x - 1].value, dataframe['timestamp'][x + 1].value) for x in filtered] |
|
|
|
# TODO: convert from ns to ms more proper way (not dividing by 10^6) |
|
|
|
|
|
|
|
return [(dataframe['timestamp'][x - 1].value / 1000000, dataframe['timestamp'][x + 1].value / 1000000) for x in filtered] |
|
|
|
|
|
|
|
|
|
|
|
def __filter_prediction(self, segments: list, data: list): |
|
|
|
def __filter_prediction(self, segments: list, data: list): |
|
|
|
delete_list = [] |
|
|
|
delete_list = [] |
|
|
|