Ejemplo n.º 1
0
 def result(self, home, away): #calculate the result for current season here
     
     new = MLR()
     new.calculate_points(home, away)
     new.count_h2h(home, away)
     new.current_standings(home, away)
     new.current_season_games(home, away)
     new.last_4_games_this_season(home,away)
     new.X()
     
     self.X = new.x[0]
     self.X = np.matrix(self.X)
     # check if x-values lie between the limits of the training set
     for i in xrange(13):
         if self.X[0,i] > self.x_max[i]:
             self.X[0,i] = self.x_max[i]
         if self.X[0,i] < self.x_min[i]:
             self.X[0,i] = self.x_min[i]
     self.X = np.concatenate((self.X,np.matrix('1')),axis = 1)
     return
Ejemplo n.º 2
0
    def result(self, home,
               away):  #calculate the result for current season here

        new = MLR()
        new.calculate_points(home, away)
        new.count_h2h(home, away)
        new.current_standings(home, away)
        new.current_season_games(home, away)
        new.last_4_games_this_season(home, away)
        new.X()

        self.X = new.x[0]
        self.X = np.matrix(self.X)
        # check if x-values lie between the limits of the training set
        for i in xrange(13):
            if self.X[0, i] > self.x_max[i]:
                self.X[0, i] = self.x_max[i]
            if self.X[0, i] < self.x_min[i]:
                self.X[0, i] = self.x_min[i]
        self.X = np.concatenate((self.X, np.matrix('1')), axis=1)
        return