(self, data, csv_path, save_csv=True)
| 48 | print(model.evaluate(test_data, test_data)) |
| 49 | |
| 50 | def encode_data(self, data, csv_path, save_csv=True): |
| 51 | coded_train = [] |
| 52 | for i in range(len(data)): |
| 53 | curr_data = np.array(data.iloc[i, :]) |
| 54 | values = np.reshape(curr_data, (1, 1, self.input_shape)) |
| 55 | coded = self.encoder.predict(values) |
| 56 | shaped = np.reshape(coded, (20,)) |
| 57 | coded_train.append(shaped) |
| 58 | |
| 59 | train_coded = pd.DataFrame(coded_train, index=np.arange(len(coded_train)), columns=np.arange(20)) |
| 60 | if save_csv: |
| 61 | train_coded.to_csv(f"{csv_path}") |
| 62 | return train_coded |
| 63 |
no outgoing calls
no test coverage detected