src/mlpack/tests/lars_test.cpp
BOOST_AUTO_TEST_CASE(NoCholeskySingularityTest)
{
  arma::mat X;
  arma::mat Y;

  data::Load("lars_dependent_x.csv", X);
  data::Load("lars_dependent_y.csv", Y);

  arma::rowvec y = Y.row(0);

  // Test for a couple values of lambda1.
  for (double lambda1 = 0.0; lambda1 < 1.0; lambda1 += 0.1)
  {
    LARS lars(false, lambda1, 0.0);
    arma::vec betaOpt;
    lars.Train(X, y, betaOpt);

    arma::vec errCorr = (X * X.t()) * betaOpt - X * y.t();

    // #373: this test fails on i386 only sometimes.
//    LARSVerifyCorrectness(betaOpt, errCorr, lambda1);
  }
}
// Same as the above test but with no cholesky factorization.
Same as the above test but with no cholesky factorization.
Same as the above test but with no cholesky factorization .
BOOST_AUTO_TEST_CASE(NoCholeskySingularityTest)
{
  arma::mat X;
  arma::mat Y;
  data::Load("lars_dependent_x.csv", X);
  data::Load("lars_dependent_y.csv", Y);
  arma::rowvec y = Y.row(0);
  for (double lambda1 = 0.0; lambda1 < 1.0; lambda1 += 0.1)
  {
    LARS lars(false, lambda1, 0.0);
    arma::vec betaOpt;
    lars.Train(X, y, betaOpt);
    arma::vec errCorr = (X * X.t()) * betaOpt - X * y.t();
  }
}
BOOST_AUTO_TEST_CASE ( NoCholeskySingularityTest ) { arma :: mat X ; arma :: mat Y ; data :: Load ( " " , X ) ; data :: Load ( " " , Y ) ; arma :: rowvec y = Y . row ( 0 ) ; for ( double lambda1 = 0.0 ; lambda1 < 1.0 ; lambda1 += 0.1 ) { LARS lars ( false , lambda1 , 0.0 ) ; arma :: vec betaOpt ; lars . Train ( X , y , betaOpt ) ; arma :: vec errCorr = ( X * X . t ( ) ) * betaOpt - X * y . t ( ) ; } }
Same as the above test but with no cholesky factorization.
Same as the above test but with no cholesky factorization .
// Test for a couple values of lambda1. // #373: this test fails on i386 only sometimes. //    LARSVerifyCorrectness(betaOpt, errCorr, lambda1);