Exemplo n.º 1
0
class SingleTeamPattern(AllPattern):
    name = ImmutableProperty('SingleTeam')

    selected_team = None

    @property
    def team_1(self):
        if self.selected_team: return [self.selected_team]

        return ["FaZe"]

    @property
    def team_2(self):
        return CsGoRank.cs_mid_tier
        #return ["NiP", "Complexity", "Astralis", "ENCE", "Natus Vincere", "Spirit", "Heretics", "BIG",
        #    "G2", "FaZe", "mousesports", "fnatic", "Vitality", "MAD Lions", "GODSENT", "Dignitas"]
        #return ["OG", "Alliance", "Ninjas in Pyjamas", "Virtus.pro", "HellRaisers", "Nigma",
        #    "Team Liquid", "FlyToMoon", "Natus Vincere", "ViKin.gg", "VP.Prodigy"]
        #return ["PSG.LGD", "Vici Gaming", "INVICTUS GAMING",
        #    "Royal Never Give Up", "Team Aster", "EHOME", "CDEC "]

    @functools.lru_cache(maxsize=None)
    def get_teams(self) -> Tuple[set, set]:
        teams_1, teams_2 = self.team_1, self.team_2

        #for season in self.dataset.get_seasons(self.season):
        #    points_table = season.get_table(metric='points')
        #    #teams_2.extend(list(points_table)[0:30])

        return set(teams_1), set(teams_2)
Exemplo n.º 2
0
class AllPattern(ScoringPattern):

    name = ImmutableProperty('All')

    @property
    def team_1(self):
        return {
            'attack': {
                'min': 0.1,
                'max': 5
            },
            'defence': {
                'min': 0.1,
                'max': 5
            }
        }

    @property
    def team_2(self):
        return {
            'attack': {
                'min': 0.1,
                'max': 5
            },
            'defence': {
                'min': 0.1,
                'max': 5
            }
        }
Exemplo n.º 3
0
class StrongVsAveragePattern(ScoringPattern):

    name = ImmutableProperty('StrongVsAverage')

    @property
    def team_1(self):
        return {
            'attack': {
                'min': 1.9,
                'max': 1.75
            },
            'defence': {
                'min': 0.9,
                'max': 1.75
            }
        }

    @property
    def team_2(self):
        return {
            'attack': {
                'min': 1.3,
                'max': 1.9
            },
            'defence': {
                'min': 1.0,
                'max': 1.6
            }
        }
Exemplo n.º 4
0
class WeakDefWithWeakDefPattern(ScoringPattern):

    name = ImmutableProperty('WeakDefWithWeakDef')

    @property
    def team_1(self):
        return {
            'attack': {
                'min': 0.8,
                'max': 1.65
            },
            'defence': {
                'min': 0.0,
                'max': 1.3
            }
        }

    @property
    def team_2(self):
        return {
            'attack': {
                'min': 0.0,
                'max': 1.3
            },
            'defence': {
                'min': 1.3,
                'max': 1.9
            }
        }
Exemplo n.º 5
0
class StrongAttVsStrongDefPattern(ScoringPattern):

    name = ImmutableProperty('StrongAttVsWeakDef')

    @property
    def team_1(self):
        return {
            'attack': {
                'min': 1.0,
                'max': 1.7
            },
            'defence': {
                'min': 1.1,
                'max': 2.0
            }
        }

    @property
    def team_2(self):
        return {
            'attack': {
                'min': 0.8,
                'max': 1.5
            },
            'defence': {
                'min': 0.8,
                'max': 1.5
            }
        }
Exemplo n.º 6
0
class StrongWithStrongPattern(ScoringPattern):

    name = ImmutableProperty('StrongWithStrong')

    @property
    def team_1(self):
        return {
            'attack': {
                'min': 0.0,
                'max': 1.3
            },
            'defence': {
                'min': 1.2,
                'max': 1.93
            }
        }

    @property
    def team_2(self):
        return {
            'attack': {
                'min': 1.55,
                'max': 2.5
            },
            'defence': {
                'min': 0.7,
                'max': 1.55
            }
        }
Exemplo n.º 7
0
class StrongWithWeakPattern(ScoringPattern):

    name = ImmutableProperty('StrongWithWeak')

    @property
    def team_1(self):
        return {
            'attack': {
                'min': 1.4,
                'max': 3.1
            },
            'defence': {
                'min': 0.0,
                'max': 0.9
            }
        }

    @property
    def team_2(self):
        return {
            'attack': {
                'min': 1.1,
                'max': 2.0
            },
            'defence': {
                'min': 1.0,
                'max': 1.7
            }
        }
Exemplo n.º 8
0
class TopLeagueVsRestPattern(LeagueStrengthPattern):
    name = ImmutableProperty('TopLeagueVsRest')

    @property
    def team_1(self):
        return {'strength': {'min': 0, 'max': 0}}

    @property
    def team_2(self):
        return {'strength': {'min': 1, 'max': 2}}
Exemplo n.º 9
0
class MidweekGamesPattern(AllPattern):
    name = ImmutableProperty('MidweekGames')

    def get_games(self, games_to_test: int, dataset: list = None):
        teams_1, teams_2 = self.get_teams()
        if not dataset: dataset = self.dataset.observations

        midweek = filter(lambda g: self.str_to_datetime(g).\
                         weekday() < 5, dataset)
        return super().get_games(games_to_test, midweek)
Exemplo n.º 10
0
class MidtableVsMidtablePattern(StandingsPattern):
    name = ImmutableProperty('MidtableVsMidtable')

    @property
    def team_1(self):
        return {'standings': {'min': 0, 'max': 3}}

    @property
    def team_2(self):
        return {'standings': {'min': 3, 'max': 6}}
Exemplo n.º 11
0
class LeadersVsMidtablePattern(StandingsPattern):
    name = ImmutableProperty('LeadersVsMidtable')

    @property
    def team_1(self):
        return {'standings': {'min': 5, 'max': 11}}

    @property
    def team_2(self):
        return {'standings': {'min': 2, 'max': 5}}
Exemplo n.º 12
0
class LeadersVsDogsPattern(StandingsPattern):
    name = ImmutableProperty('LeadersVsDogs')

    @property
    def team_1(self):
        return {'standings': {'min': 12, 'max': 17}}

    @property
    def team_2(self):
        return {'standings': {'min': 12, 'max': 16}}
Exemplo n.º 13
0
class EventsPattern(AllPattern):
    name = ImmutableProperty('MidweekGames')

    def is_major_event(self, g):
        return g.Event.startswith(
            ('ESL One', 'StarLadder ImbaTV', 'Dota Summit', 'EPICENTER Major',
             'MDL Chengdu Major'))

    def get_games(self, games_to_test: int, dataset: list = None):
        teams_1, teams_2 = self.get_teams()
        if not dataset: dataset = self.dataset.observations

        games = filter(lambda g: self.is_major_event(g), dataset)
        return super().get_games(games_to_test, games)
Exemplo n.º 14
0
class MLSWestConfPattern(MLSConfPattern):

    name = ImmutableProperty('MLSWestConf')
    team_1 = property(lambda self: 'LA Lakers')
    team_2 = property(lambda self: self.team_1)
Exemplo n.º 15
0
class MLSEastConfPattern(MLSConfPattern):

    name = ImmutableProperty('MLSEastConf')
    team_1 = property(lambda self: 'DC United')
    team_2 = property(lambda self: self.team_1)