diff --git a/toolkit.py b/toolkit.py index 51efd3f04d6f0c0078694f168fa4fcffe13cd0ad..cc479a4cde0d64e856597e4a4d3a9df9ff681da6 100755 --- a/toolkit.py +++ b/toolkit.py @@ -802,35 +802,6 @@ class ClassificationProject(object): self._transform_data() - def shuffle_training_data(self): - - if not self.data_loaded: - raise ValueError("Data not loaded! can't shuffle training data!") - - if self.data_shuffled: - logger.warning("Data already shuffled, won't shuffle again") - - np.random.seed(self.shuffle_seed) - - # touch property to make sure it is created - # before shuffling the inputs! - self.w_train_tot - - rn_state = np.random.get_state() - np.random.shuffle(self.x_train) - np.random.set_state(rn_state) - np.random.shuffle(self.y_train) - np.random.set_state(rn_state) - np.random.shuffle(self.w_train) - np.random.set_state(rn_state) - np.random.shuffle(self.w_train_tot) - if self._scores_train is not None: - logger.info("Shuffling scores, since they are also there") - np.random.set_state(rn_state) - np.random.shuffle(self._scores_train) - self.data_shuffled = True - - @property def w_train_tot(self): "(sample weight * class weight), divided by mean"