18 using namespace Eigen;
41 void CLinearMachine::init()
81 SG_ERROR(
"Specified features are not of type CDotFeatures\n")
152 REQUIRE(data,
"No features provided and no featured previously set\n");
155 "Number of training vectors (%d) does not match number of labels (%d)\n",
165 set_bias((eigen_labels - eigen_outputs).mean()) ;
174 SG_ERROR(
"train data_lock() was called, only train_locked() is"
175 " possible. Call data_unlock if you want to call train()\n",
virtual CBinaryLabels * apply_binary(CFeatures *data=NULL)
virtual void dense_dot_range(float64_t *output, int32_t start, int32_t stop, float64_t *alphas, float64_t *vec, int32_t dim, float64_t b)
virtual bool train(CFeatures *data=NULL)
virtual SGVector< float64_t > apply_get_outputs(CFeatures *data)
Real Labels are real-valued labels.
virtual CRegressionLabels * apply_regression(CFeatures *data=NULL)
virtual void set_w(const SGVector< float64_t > src_w)
virtual float64_t dense_dot(int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)=0
virtual int32_t get_num_labels() const =0
virtual int32_t get_num_vectors() const =0
virtual bool train_machine(CFeatures *data=NULL)
virtual CDotFeatures * get_features()
Features that support dot products among other operations.
A generic learning machine interface.
virtual int32_t get_dim_feature_space() const =0
virtual float64_t apply_one(int32_t vec_idx)
Class SGObject is the base class of all shogun objects.
virtual const char * get_name() const
virtual CLabels * get_labels()
virtual bool get_compute_bias()
virtual void set_features(CDotFeatures *feat)
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
virtual void store_model_features()
virtual SGVector< float64_t > get_w() const
virtual ~CLinearMachine()
virtual void set_compute_bias(bool compute_bias)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual float64_t get_bias()
SGVector< T > clone() const
Binary Labels for binary classification.
virtual void set_bias(float64_t b)
virtual bool train_require_labels() const
bool has_property(EFeatureProperty p) const
virtual void ensure_valid(const char *context=NULL)=0
void compute_bias(CFeatures *data)