Beispiel #1
0
    def combine(self, prediction_groups: typing.Dict,
                inputs: container.DataFrame):
        all_results = []

        only_one = 'only_one_time_series' in prediction_groups
        for i, row in inputs.iterrows():
            # date = pd.Timestamp(et.time_indicator.get_datetime(row))
            date = self.time_indicator.get_datetime(row)
            if only_one:
                key = 'only_one_time_series'
            else:
                key = []
                for x in self.categorical_indices:
                    key.append(row.iloc[x])
                key = tuple(key)
            predictions = prediction_groups[key]
            all_results.append(predictions.loc[date, 0])
        return np.array(all_results).T
Beispiel #2
0
 def _convert_lists(dataframe: container.DataFrame) -> container.DataFrame:
     # convert colum contents to numpy array of values similar to what extract semantic types would do
     for index, row in dataframe.iterrows():
         row["bravo"] = container.ndarray([int(i) for i in row["bravo"].split(",")])
     return dataframe