from data.scripts.generate_data import scrape_players
from data.tournament.tournament import Tournament
from joblib import load
from caching import r
import pickle
from datetime import date
from tournament.model import SciKitModel


def load_tournament():
    if not r.get('tournament'):
        model = load('data/ml/scikit-perceptron.joblib')
        players, stats = scrape_players(2021)
        t = Tournament(players, stats, SciKitModel(engine=model))
        r.set('tournament', pickle.dumps(t))
        r.set('root', pickle.dumps(t.simulate()))
        r.set('time', str(date.today()))

deca91a4540eab025ada7e2b070bc6be8b88e2b4
<mask token>

<mask token>


def load_tournament():
    if not r.get('tournament'):
        model = load('data/ml/scikit-perceptron.joblib')
        players, stats = scrape_players(2021)
        t = Tournament(players, stats, SciKitModel(engine=model))
        r.set('tournament', pickle.dumps(t))
        r.set('root', pickle.dumps(t.simulate()))
        r.set('time', str(date.today()))

from data.scripts.generate_data import scrape_players
from data.tournament.tournament import Tournament
from joblib import load
from caching import r
import pickle
from datetime import date
from tournament.model import SciKitModel


def load_tournament():
    if not r.get('tournament'):
        model = load('data/ml/scikit-perceptron.joblib')
        players, stats = scrape_players(2021)
        t = Tournament(players, stats, SciKitModel(engine=model))
        r.set('tournament', pickle.dumps(t))
        r.set('root', pickle.dumps(t.simulate()))
        r.set('time', str(date.today()))
