Plot the scores of test data in LDA

Hi, I have built a Linear Discriminant Analysis model, trained with the first 200 matches of the English premier League this season (called "ldatrain" in the code). I have plotted the scores and predicted outcomes (Home win, Away Win or Draw) for this dataset, but I want to repeat this for my test data, the remaining 89 games of the league. How do I do this? The first 6 lines of my data, and code is below.

basldatrain = lda(ldatrain[,6:9], ldatrain[,1]) 
basldatrain

plot(basldatrain, cex =0.7, col = as.numeric(ldatrain[,1]))
#test

predbastest = predict(basldatrain, ldatest[,6:9])

where ldatrain is

 FTR HPPG APPG HFR AFR Avg.HGS Avg.AGS Avg.HGC Avg.AGC Distance HTD ATD
1   H 2.55 0.00  84  73    2.89    1.00    0.53    4.00      255   2   5
2   A 1.37 2.58  79  86    1.68    2.00    1.42    0.58      216   4   2
3   D 1.18 1.00  77  73    1.58    1.00    1.32    1.00      183   3   3
4   H 1.05 1.03  77  76    1.26    0.95    1.68    1.84      203   2   3
5   D 1.29 1.42  77  79    1.00    1.26    1.21    1.32      186   2   2
6   A 1.32 0.95  77  76    1.37    0.84    1.47    1.68       56   2   2

and ldatest is the same format but with the remaining matches.

Thanks!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.