mlpack
lars_impl.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_METHODS_LARS_LARS_IMPL_HPP
13 #define MLPACK_METHODS_LARS_LARS_IMPL_HPP
14 
16 #include "lars.hpp"
17 
18 namespace mlpack {
19 namespace regression {
20 
24 template<typename Archive>
25 void LARS::serialize(Archive& ar, const uint32_t /* version */)
26 {
27  // If we're loading, we have to use the internal storage.
28  if (cereal::is_loading<Archive>())
29  {
30  matGram = &matGramInternal;
31  ar(CEREAL_NVP(matGramInternal));
32  }
33  else
34  {
35  ar(cereal::make_nvp("matGramInternal",
36  (const_cast<arma::mat&>(*matGram))));
37  }
38 
39  ar(CEREAL_NVP(matUtriCholFactor));
40  ar(CEREAL_NVP(useCholesky));
41  ar(CEREAL_NVP(lasso));
42  ar(CEREAL_NVP(lambda1));
43  ar(CEREAL_NVP(elasticNet));
44  ar(CEREAL_NVP(lambda2));
45  ar(CEREAL_NVP(tolerance));
46  ar(CEREAL_NVP(betaPath));
47  ar(CEREAL_NVP(lambdaPath));
48  ar(CEREAL_NVP(activeSet));
49  ar(CEREAL_NVP(isActive));
50  ar(CEREAL_NVP(ignoreSet));
51  ar(CEREAL_NVP(isIgnored));
52 }
53 
54 } // namespace regression
55 } // namespace mlpack
56 
57 #endif
void serialize(Archive &ar, const uint32_t)
Serialize the LARS model.
Definition: lars_impl.hpp:25
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1