Esempio n. 1
0
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()
Esempio n. 2
0
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()
Esempio n. 3
0
 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
Esempio n. 4
0
 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