Skip to content
Snippets Groups Projects
Commit f5c6c26a authored by Thomas Purcell's avatar Thomas Purcell
Browse files

slight modifications to python interface and regressor changes

don't reset inds, just don't loop in initial inds.back() < 0
parent ef7acbb2
Branches
No related tags found
No related merge requests found
Pipeline #82900 passed
......@@ -92,14 +92,12 @@ void SISSORegressor::l0_norm(std::vector<double>& prop, int n_dim)
for(int rr = 0; rr < n_dim; ++rr)
inds[rr] = _feat_space->phi_selected().size() - 1 - rr;
util_funcs::iterate(inds, inds.size(), _mpi_comm->rank());
if(inds.back() < 0)
for(int rr = 0; rr < n_dim; ++rr)
inds[rr] = _feat_space->phi_selected().size() - 1 - rr;
util_funcs::iterate(inds, inds.size(), _mpi_comm->rank());
int max_error_ind = 0;
if(inds.back() >= 0)
{
do {
int start = 0;
double error = 0.0;
......@@ -120,6 +118,7 @@ void SISSORegressor::l0_norm(std::vector<double>& prop, int n_dim)
max_error_ind = std::max_element(min_errors.begin(), min_errors.end()) - min_errors.begin();
}
} while(util_funcs::iterate(inds, inds.size(), _mpi_comm->size()));
}
std::vector<double> all_min_error(_mpi_comm->size() * n_get_models);
std::vector<int> all_inds_min(_mpi_comm->size() * n_get_models * n_dim);
......
......
......@@ -3,7 +3,7 @@ import numpy as np
from cpp_sisso import ModelClassifier
def update_model_svm(model, c=1.0, max_iter=100000, tol=0.01, filename=None):
def update_model_svm(model, c=1.0, max_iter=-1, tol=0.0001, filename=None):
"""Generate a new model with an updated SVM from sckitlearn
Args:
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment