dmlfw (Daniyal Machine Learning Framework)
|
Tests a linear regression model by predicting and evaluating accuracy using R2 score. More...
void | load_dataset (dmlfw_mat_double **x, dmlfw_column_vec_double **y, dmlfw_column_vec_double **model) |
Loads test dataset features X, target values Y, and model parameters. | |
int | main (int argc, char *argv[]) |
Main function to run the model testing example. | |
char * | MODEL |
void | print_error_and_exit () |
Prints the ml-framework error string and exits the program. | |
#define | TESTING_DATASET "IceCreamSales_testing_examples.csv" |
Tests a linear regression model by predicting and evaluating accuracy using R2 score.
This tool loads a test dataset and pre-trained model parameters, makes predictions using ml-framework linear regression prediction functionality, computes the R2 accuracy score, and prints the result. It also handles errors and resource cleanup.
Usage: ./gd_test_model model_csv_file
Parameters:
#define TESTING_DATASET "IceCreamSales_testing_examples.csv" |
void load_dataset | ( | dmlfw_mat_double ** | x, |
dmlfw_column_vec_double ** | y, | ||
dmlfw_column_vec_double ** | model | ||
) |
Loads test dataset features X, target values Y, and model parameters.
The dataset used is fixed to IceCreamSales_testing_examples.csv. A bias column of all 1.0 is prepended to features.
[out] | x | Pointer to features matrix pointer. |
[out] | y | Pointer to target column vector pointer. |
[out] | model | Pointer to model parameters vector pointer. |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function to run the model testing example.
Loads dataset and model, performs prediction, computes accuracy using R2 score, prints accuracy, and manages resources.
argc | Argument count. |
argv | Argument vector. |
void print_error_and_exit | ( | ) |
Prints the ml-framework error string and exits the program.
char* MODEL |