13 set_liblinear_solver_type(l);
18 set_liblinear_solver_type(L2R_L1LOSS_SVC_DUAL);
19 set_bias_enabled(
false);
24 set_compute_bias(
false);
26 SG_ADD(&C1,
"C1",
"C Cost constant 1.", MS_AVAILABLE);
27 SG_ADD(&C2,
"C2",
"C Cost constant 2.", MS_AVAILABLE);
29 &use_bias,
"use_bias",
"Indicates if bias is used.", MS_NOT_AVAILABLE);
30 SG_ADD(&epsilon,
"epsilon",
"Convergence precision.", MS_NOT_AVAILABLE);
32 &max_iterations,
"max_iterations",
"Max number of iterations.",
34 SG_ADD(&m_linear_term,
"linear_term",
"Linear Term", MS_NOT_AVAILABLE);
36 (machine_int_t*)&liblinear_solver_type,
"liblinear_solver_type",
37 "Type of LibLinear solver.", MS_NOT_AVAILABLE);
44 if (liblinear_solver_type == L1R_LR ||
45 liblinear_solver_type == L2R_LR_DUAL ||
46 liblinear_solver_type == L2R_LR )
48 SGVector<float64_t> outputs = apply_get_outputs(data);
52 dynamic_cast<CBinaryLabels*
>(labels)->scores_to_probabilities();
60 for (
int i = 0;
i < outputs.size(); ++
i)
62 labels->set_value(1/(1+exp(-outputs[
i])),
i);
void predict_probability(CLabels *labels, const SGVector< float64_t > &outputs)
CMyLibLinear(LIBLINEAR_SOLVER_TYPE liblinear_solver_type)
void set_probabilities(CLabels *labels, CFeatures *data)