15 using namespace shogun;
39 SG_ERROR(
"Specified features are not of type CDotFeatures\n");
57 for (int32_t i=0; i<num_feat; i++)
65 for (int32_t i=0; i<num_vec; i++)
69 if (CMath::sign<float64_t>(output[i]) != train_labels.
vector[i])
81 SG_INFO(
"Perceptron algorithm converged after %d iterations.\n", iter);
bool has_property(EFeatureProperty p)
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_vectors() const =0
virtual void add_to_dense_vec(float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)=0
Features that support dot products among other operations.
virtual int32_t get_dim_feature_space() const =0
virtual void free_vector()
SGVector< int32_t > get_int_labels()
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
The class Features is the base class of all feature objects.
virtual void set_features(CDotFeatures *feat)
virtual bool train_machine(CFeatures *data=NULL)
virtual void set_labels(CLabels *lab)
virtual CLabels * apply()
#define SG_MALLOC(type, len)