20 using namespace shogun;
23 : CLinearClassifier(), C1(1), C2(1), use_bias(true), epsilon(1e-3)
38 SG_ERROR(
"Specified features are not of type CDotFeatures\n");
42 int32_t num_train_labels=labels->get_num_labels();
43 int32_t num_feat=features->get_dim_feature_space();
44 int32_t num_vec=features->get_num_vectors();
46 ASSERT(num_vec==num_train_labels);
51 int32_t num_params=1+2*num_feat+num_vec;
53 memset(params,0,
sizeof(
float64_t)*num_params);
59 if (get_max_train_time()>0)
65 for (int32_t i=0; i<num_feat; i++)
66 w[i]=params[1+i]-params[1+num_feat+i];
bool has_property(EFeatureProperty p)
Class CCplex to encapsulate access to the commercial cplex general purpose optimizer.
bool init(E_PROB_TYPE t, int32_t timeout=60)
init cplex with problem type t and retry timeout 60 seconds
bool set_time_limit(float64_t seconds)
bool optimize(float64_t *sol, float64_t *lambda=NULL)
bool setup_lpm(float64_t C, CSparseFeatures< float64_t > *x, CLabels *y, bool use_bias)
virtual void set_features(CDotFeatures *feat)
Features that support dot products among other operations.
static void display_vector(const T *vector, int32_t n, const char *name="vector")
display vector (useful for debugging)
virtual bool train_machine(CFeatures *data=NULL)
The class Features is the base class of all feature objects.
#define SG_MALLOC(type, len)