diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-06-01 20:54:52 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-06-01 20:54:52 +0200 |
| commit | 92f1a61cdca682e1b3cd126febe9182b795f8453 (patch) | |
| tree | 66c872f38ea2a364f815d7f582cdb560754a02fc | |
| parent | be84a193e0c3bd7f47e58706af6550c24669001f (diff) | |
| download | analyzer-92f1a61cdca682e1b3cd126febe9182b795f8453.tar.gz analyzer-92f1a61cdca682e1b3cd126febe9182b795f8453.zip | |
make TS match VST
| -rw-r--r-- | Dockerfile | 4 | ||||
| -rw-r--r-- | requirements.txt | 1 | ||||
| -rw-r--r-- | worker.py | 10 |
3 files changed, 8 insertions, 7 deletions
@@ -4,7 +4,7 @@ RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY . /usr/src/app -RUN apt-get update && apt-get install -y git && apt-get clean -RUN pip install virtualenv && virtualenv venv && pip install -r requirements.txt +RUN apt-get update && apt-get install -y --no-install-recommends git && apt-get clean +RUN pip install virtualenv && virtualenv venv && pip install -r requirements.txt && pip install git+git://github.com/zzzeek/sqlalchemy CMD ["python", "worker.py"] diff --git a/requirements.txt b/requirements.txt index ad82fa6..fa558da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,6 @@ protobuf==3.2.0 pyparsing==2.2.0 six==1.10.0 snakeviz==0.4.1 --e git+git://github.com/zzzeek/sqlalchemy@f8b4f7#egg=sqlalchemy tensorflow==1.1.0rc1 tornado==4.5.1 trueskill==0.4.4 @@ -54,7 +54,7 @@ def connect(): # generate schema from db Base = automap_base() - engine = create_engine(DATABASE_URI) + engine = create_engine(DATABASE_URI, pool_size=1, pool_recycle=3600) while True: try: Base.prepare(engine, reflect=True) @@ -136,7 +136,8 @@ def process(): mu=11.0/30*3000, sigma=3000/3, beta=11.0/30*3000 /2, - tau=3000/3 /100 + tau=3000/3 /100, + draw_probability=0 ) for match in db.query(Match).options(\ load_only("api_id")\ @@ -158,7 +159,7 @@ def process(): sigma = participant.trueskill_sigma or player.trueskill_sigma if mu is None: # no data -> approximate ts by VST - mu = vst_points[participant.skill_tier] + mu = 3/2 * vst_points[participant.skill_tier] sigma = mu / 3 player.trueskill_mu = mu player.trueskill_sigma = sigma @@ -171,6 +172,7 @@ def process(): if len(matchup) != 2: logging.error("got an invalid matchup", match.api_id) + match.trueskill_quality = 0 continue # store the fairness of the match @@ -180,7 +182,7 @@ def process(): # lower rank is better = winner! for rating, participant in zip(team, roster.participants): player = participant.player[0] - participant.trueskill_delta = (rating.mu + rating.sigma) - (float(player.trueskill_mu) + float(player.trueskill_sigma)) + participant.trueskill_delta = (rating.mu - rating.sigma) - (float(player.trueskill_mu) - float(player.trueskill_sigma)) if player.trueskill_mu == participant.trueskill_mu \ and player.trueskill_sigma == participant.trueskill_sigma: # match hasn't been rated before |
