-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
40 lines (30 loc) · 1.41 KB
/
Copy pathmain.cpp
File metadata and controls
40 lines (30 loc) · 1.41 KB
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
32
33
34
35
36
37
38
39
40
#include "driver.hh"
#include "team.hh"
#include "utility.hh"
int main() {
// Create vectors with all drivers and all teams
std::vector<Driver> drivers = read_drivers("data/drivers.csv");
std::vector<Team> teams = read_teams("data/teams.csv");
// Read race results and compute the expected performace
read_race_results("data/driver_results_2024.csv","data/team_results_2024.csv",drivers,teams);
// Feature matrix and labels (for XGBoost training)
std::vector<float> feature_matrix;
std::vector<float> labels;
// Prepare the dataset for training
prepare_dataset(drivers, feature_matrix, labels);
// Train the XGBoost model and save it to a file
std::string model_path = "xgboost_model.bin";
train_xgboost_model(feature_matrix, labels, model_path);
fine_tune_xgboost_model(drivers, model_path, 3);
std::cout << "Model trained and saved to " << model_path << std::endl;
// Compute the expected performance utilizing the ML model and simple stochastics
calculate_expected_performance_ML(drivers, model_path);
calculate_expected_performace_combi(drivers,teams);
// Print out the drivers and teams for verification
print_drivers(drivers);
print_teams(teams);
// Find the optimal team based on points and budget
std::cout<<"Searching for optimal team\n"<<std::endl;
find_optimal_team(drivers, teams, model_path);
return 0;
}