feature_matrix_train: Training feature matrix

Description Usage Arguments Value Examples

View source: R/feature_matrix.R

Description

Makes the feature matrix to train on based on which features are chosen. Uses functions: player_data_frame, head_to_head, feature_surface.

Usage

1
feature_matrix_train(my_data,match_date = "2019-01-01",features = c('surface_form', 'age', 'match_form', 'head_to_head'), carpet = 'FALSE')

Arguments

my_data

input data.

match_date

set to the starting date of test data - by default this is 2019-01-01.

features

a list of features wanted to be included. By default all features are used.

carpet

as matches are no longer played on carpet, carpet performance is by default not included. However, carpet can be included by including, carpet == 'TRUE'

Value

Creates a matrix where each row is a feature and each column is a match. Additionally, a row of ones is added for the intercept and a row which signifies the winner of that match - set to +1 if player 1 one and -1 if player 2 won.

Examples

1
2
feature_matrix_train(data)
feature_matrix_train(my_data,match_date = "2018-05-11",features = c('surface_form', 'match_form', 'head_to_head'), carpet = 'TRUE')

ss15859/tennis.wta documentation built on Jan. 24, 2021, 12:46 a.m.