| 93 | } |
| 94 | |
| 95 | std::tuple<Eigen::VectorXd, double, double, double, double> pywrap_RPCA( |
| 96 | Eigen::MatrixXd x_Mat, int n, int p, int normalize_type, int max_iter, int exchange_num, int path_type, |
| 97 | bool is_warm_start, int eval_type, double ic_coef, Eigen::VectorXi gindex_Vec, Eigen::VectorXi sequence_Vec, |
| 98 | Eigen::VectorXd lambda_sequence_Vec, int s_min, int s_max, double lambda_min, double lambda_max, int n_lambda, |
| 99 | int screening_size, Eigen::VectorXi always_select_Vec, int primary_model_fit_max_iter, |
| 100 | double primary_model_fit_epsilon, bool early_stop, int thread, bool sparse_matrix, int splicing_type, |
| 101 | int sub_search, Eigen::VectorXi A_init_Vec) { |
| 102 | List mylist = |
| 103 | abessRPCA_API(x_Mat, n, p, max_iter, exchange_num, path_type, is_warm_start, eval_type, ic_coef, sequence_Vec, |
| 104 | lambda_sequence_Vec, s_min, s_max, lambda_min, lambda_max, n_lambda, screening_size, |
| 105 | primary_model_fit_max_iter, primary_model_fit_epsilon, gindex_Vec, always_select_Vec, early_stop, |
| 106 | thread, sparse_matrix, splicing_type, sub_search, A_init_Vec); |
| 107 | |
| 108 | Eigen::VectorXd beta; |
| 109 | double coef0 = 0; |
| 110 | double train_loss = 0; |
| 111 | double test_loss = 0; |
| 112 | double ic = 0; |
| 113 | mylist.get_value_by_name("beta", beta); |
| 114 | mylist.get_value_by_name("coef0", coef0); |
| 115 | mylist.get_value_by_name("train_loss", train_loss); |
| 116 | mylist.get_value_by_name("test_loss", test_loss); |
| 117 | mylist.get_value_by_name("ic", ic); |
| 118 | |
| 119 | return std::make_tuple(beta, coef0, train_loss, test_loss, ic); |
| 120 | } |
| 121 | |
| 122 | PYBIND11_MODULE(pybind_cabess, m) { |
| 123 | m.def("pywrap_GLM", &pywrap_GLM); |
no test coverage detected