コード例 #1
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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)
コード例 #2
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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
            }
        }
コード例 #3
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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
            }
        }
コード例 #4
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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
            }
        }
コード例 #5
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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
            }
        }
コード例 #6
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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
            }
        }
コード例 #7
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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
            }
        }
コード例 #8
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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}}
コード例 #9
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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)
コード例 #10
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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}}
コード例 #11
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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}}
コード例 #12
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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}}
コード例 #13
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
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)
コード例 #14
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
class MLSWestConfPattern(MLSConfPattern):

    name = ImmutableProperty('MLSWestConf')
    team_1 = property(lambda self: 'LA Lakers')
    team_2 = property(lambda self: self.team_1)
コード例 #15
0
ファイル: searchers.py プロジェクト: yaroslav-dudar/fox.cub
class MLSEastConfPattern(MLSConfPattern):

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