def estimate(self, raw_test_dataset, measures): with tl.Timer() as t: error = self._estimate(raw_test_dataset, measures) print("{} algorithm predict process cost {:.3f} sec".format( self.__class__.__name__, t.interval)) return error
def estimate(test, measures, train_sparse, bu, bi, y, c, w, q, p, global_mean): with tl.Timer() as t: error = _estimate(test, measures, train_sparse, bu, bi, y, c, w, q, p, global_mean) error = np.sqrt(np.mean(np.power(error, 2))) return error
def train(self, train_dataset): self.train_dataset = train_dataset with tl.Timer() as t: self._train() print("{} algorithm train process cost {:.3f} sec".format( self.__class__.__name__, t.interval))
def train(self, train_dataset, user_dataset=None): self.train_dataset = train_dataset self.user_dataset = user_dataset with tl.Timer() as t: self._train() logger.info("{} algorithm train process cost {:.3f} sec".format( self.__class__.__name__, t.interval))