14 #include <shogun/lib/external/ssl.h>
47 SG_ERROR(
"Specified features are not of type CDotFeatures\n")
59 struct options Options;
61 struct vector_double Weights;
62 struct vector_double Outputs;
69 Data.Y=train_labels.
vector;
74 Options.lambda=1/(2*
get_C1());
75 Options.lambda_u=1/(2*
get_C1());
79 Options.cgitermax=10000;
80 Options.mfnitermax=50;
89 for (int32_t i=0;i<num_vec;i++)
91 if(train_labels.
vector[i]>0)
96 ssl_train(&Data, &Options, &Weights, &Outputs);
97 ASSERT(Weights.vec && Weights.d==num_feat+1)
100 for (int32_t i=0; i<num_feat+1; i++)
107 SG_FREE(Outputs.vec);
virtual void set_w(const SGVector< float64_t > src_w)
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_vectors() const =0
Features that support dot products among other operations.
virtual int32_t get_dim_feature_space() const =0
virtual void set_features(CDotFeatures *feat)
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
all of classes and functions are contained in the shogun namespace
virtual bool train_machine(CFeatures *data=NULL)
The class Features is the base class of all feature objects.
Binary Labels for binary classification.
virtual void set_bias(float64_t b)
bool has_property(EFeatureProperty p) const
virtual void set_labels(CLabels *lab)