Skip to content

Commit 0de4ee7

Browse files
adding a test
1 parent e1d2675 commit 0de4ee7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cpp/test ALRRegressor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ using namespace Eigen;
1111

1212
int main()
1313
{
14+
std::vector<bool> tests;
15+
tests.reserve(1000);
16+
1417
//Model
1518
APLRRegressor model{APLRRegressor()};
1619
model.m=100;
@@ -48,6 +51,10 @@ int main()
4851
save_data("data/output.csv",predictions);
4952

5053
std::cout<<predictions.mean()<<"\n\n";
54+
tests.push_back(check_if_approximately_equal(predictions.mean(),23.4891,0.00001));
5155

5256
//std::cout<<model.validation_error_steps<<"\n\n";
57+
58+
//Test summary
59+
std::cout<<"\n\nTest summary\n"<<"Passed "<<std::accumulate(tests.begin(),tests.end(),0)<<" out of "<<tests.size()<<" tests.";
5360
}

0 commit comments

Comments
 (0)