Description Usage Arguments Value Examples
View source: R/predict.mELO_rating.R
This function gives predictions of success probabilities for agent or
player 1 from a fitted ELO or mELO model (a mELO_rating oject).
1 2 3 4 5 6 7 8 9  | 
object | 
 An object of class   | 
new_match_data | 
 A data frame containing four columns: (1) a numeric vector denoting the time period in which the game took place (2) a numeric or character identifier for player one (3) a numeric or character identifier for player two.  | 
min_games | 
 A single value. If the number of games of either player is
below this value, the prediction will be based on the   | 
default_ratings | 
 The rating to be used for agents or players who have
not yet played   | 
p1_advantage | 
 Player 1 advantage parameter. A single value or numeric
vector with length equal to the number of rows in   | 
thresh | 
 A single value. If given, a binary vector is returned indicating whether the prediction is greater than this value.  | 
A numeric vector of predictions, which may contain missing values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  | # Rock paper scissors
head(rps_df)
# Note that ELO doesn't perform well
rps_ELO <- ELO(rps_df)
rps_ELO
ELO_preds <- predict(
    rps_ELO,
    head(rps_df)
)
cbind(
    head(rps_df),
    ELO_preds
)
    # Predictions are all ~0.5
# Fit a mELO model that can handle these types of interactions.
rps_mELO <- mELO(rps_df, k=1)
rps_mELO
# Inspect advantage matrix
get_adv_mat(rps_mELO)
# Get predictioncs
mELO_preds <- predict(
    rps_mELO,
    head(rps_df)
)
cbind(
    head(rps_df),
    mELO_preds
)
    # Much better predictions!
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.