class SquareTest(Objective): def __init__(self, y_prediction_df, y_target_df): self.loss = Square(y_prediction_df.get_matrix(),y_target_df.get_matrix()) self.n = y_target_df.shape[0] self.yt_df = y_target_df def f(self): return np.mean(self.loss.f()) def g(self): return self.loss.g()/self.n def h(self): pass @staticmethod def structure(y_target_df): return y_target_df.rows(),y_target_df.cols()
class SquareTest(Objective): def __init__(self, y_prediction_df, y_target_df): self.loss = Square(y_prediction_df.get_matrix(), y_target_df.get_matrix()) self.n = y_target_df.shape[0] self.yt_df = y_target_df def f(self): return np.mean(self.loss.f()) def g(self): return self.loss.g() / self.n def h(self): pass @staticmethod def structure(y_target_df): return y_target_df.rows(), y_target_df.cols()
def __init__(self, y_prediction_df, y_target_df): self.loss = Square(y_prediction_df.get_matrix(),y_target_df.get_matrix()) self.n = y_target_df.shape[0] self.yt_df = y_target_df
def __init__(self, y_prediction_df, y_target_df): self.loss = Square(y_prediction_df.get_matrix(), y_target_df.get_matrix()) self.n = y_target_df.shape[0] self.yt_df = y_target_df