lucasmaystre / kickscore Goto Github PK
View Code? Open in Web Editor NEWPairwise comparisons with flexible time-dynamics.
License: MIT License
Pairwise comparisons with flexible time-dynamics.
License: MIT License
Can a ranking be produced? The "model.probabilities" accepts only two teams as input but what if you want to produce a ranking using the games played so far?
Hi there,
I'm working through your NBA example, and I'm noticing that anywhere where we're trying to use .timestamp()
, e.g.
t = datetime.strptime(row["date"], "%Y-%m-%d").timestamp()
timestamps=True
in the plotting (ts = [datetime.fromtimestamp(t) for t in ts]
)it throws an error when encountering dates before 1970, as below:
OSError: [Errno 22] Invalid argument
This doesn't happen in the online notebook, and from some googling it sounds like it's a Windows specific issue. I was able to work around it in the main section by simply manually calculating the timedelta and converting it to seconds (t = (datetime.strptime(row["date"], "%Y-%m-%d") - datetime(1970, 1, 1)).total_seconds()
), but that doesn't help me with the plotting, unfortunately.
Do you have any suggested workarounds or fixes? Let me know if any more info is needed.
Edit: To clarify, I'm running Python 3.8 in Spyder 4.1.1 on Windows
Kickscore is a rating based model.
Over time a team might loose their rating but short term a longer break than the other team is considered a plus point.
How would you solve this mathematically
hello,
first of all, congrats for your work! I was wondering if there is a guide or code for the parameter selection?
I have a dataset of online games, with 2000 players and 5000 games, I fit the model as in the nba example but results are much inferior than elo or truskill.
greetings
Is there a way to handle drawn matches? Thank you
Didnt find any information or examples about how to set up countdiff model.
what about win probas? how to calc it?
how to set up observations? similar to count model? or difference? or 50/50)
I'm attempting to apply kickscore to a game where each team has 5 players, but I've found that when I try to add a single event with multiple winners and losers the model never converges. When I have a separate event for each winner winning against each loser the model does usually converge. Is there something I should be doing differently in this scenario?
I'm trying to use the difference model, but all the returned probabilities are (0, 1), which looking at the code
prob = GaussianObservation.probability(items, threshold, var, t=t)
return (prob, 1 - prob)
suggests that the GaussianObservation.probability
is always returning zero. Any idea what's going on? I'm getting the same issue with the CountDiffModel as well.
My setup is below
model = ks.DifferenceModel()
kernel = (ks.kernel.Constant(var=0.03)
+ ks.kernel.Matern32(var=0.138, lscale=1.753*seconds_in_year))
for game in games:
determine winner, loser, point differential, and game timestamp t
observations.append({'items1': [winner],
'items2': [loser],
'diff': point differential,
't': t,
})
for obs in observations:
model.observe(**obs)
converged = model.fit()
preds = []
for game in future_games:
preds.append(model.probabilities([home_team], [away_team], game_timestamp)
which gives all the preds as (0,1)
Is it possible to add observations to a model without having to fit the entire model again? I'd like to see how kickscore performs when it has observed all matches before a certain match for all matches in my dataset, but this is not feasible when I have to run .fit
each time with 70000 matches.
Hello,
I've tried saving the trained model using pickle
and sklearn joblib
. Both breaks down with maximum recursion depth
-error. I've tried raising the default level, but the pickle job runs in what seems forever, without terminating.
Do you have a preferred method for saving a trained model?
Thanks for an excellent library!
Hi!
I am running kickscore
for some data, and when plotting the scores with plot_scores
function, the predict
method returns mean 0 and variance 1 for all data points except the first and last timestamps. For the final and the last timestamps the predictions are the sames as the values in the Item
s scores
attribute. There are some other anomalies with the score data, but this seems to be far most common one.
Here are 3 players plotted, and they all exhibit the same behaviour.
Also, why in the plot_scores
function, we calculate the ms
vector with the predict
method, but not rather just take the stored values from the scores
attributes of an Item
?
Another observation I made was that I have players who have only won matches, but their score at the end is almost the same as in the beginning? Here is a picture of a player who has won roughly 20 matches and lost 0. Shouldn't their trajectory be monotonically increasing, even if the opponents are weak? The data below is from the scores
attribute of the Item
I am using the BinaryModel
, with exponential
kernel (var=1
, lscale=1
) and recursive fitter.
All help is much appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.