24 register_parameters();
37 register_parameters();
40 void CFeatureBlockLogisticRegression::init()
56 void CFeatureBlockLogisticRegression::register_parameters()
118 ASSERT(regularization==0 || regularization==1)
124 ASSERT(termination>=0 && termination<=4)
154 for (int32_t i=0; i<n_vecs; i++)
157 slep_options options = slep_options::default_options();
163 options.loss = LOGISTIC;
166 switch (relation_type)
173 options.n_feature_blocks = ind.
vlen-1;
175 SG_ERROR(
"Group of features covers more features than available\n")
177 options.gWeight = SG_MALLOC(
double, options.n_feature_blocks);
178 for (int32_t i=0; i<options.n_feature_blocks; i++)
179 options.gWeight[i] = 1.0;
180 options.mode = FEATURE_GROUP;
181 options.loss = LOGISTIC;
185 SG_FREE(options.gWeight);
188 for (
int i=0; i<n_feats; i++)
189 new_w[i] = result.w[i];
204 options.general =
true;
206 options.ind_t = ind_t.
vector;
208 options.n_nodes = ind_t.
vlen/3;
209 options.n_feature_blocks = ind_t.
vlen/3;
210 options.mode = FEATURE_TREE;
211 options.loss = LOGISTIC;
217 for (
int i=0; i<n_feats; i++)
218 new_w[i] = result.w[i];
226 SG_ERROR(
"Not supported feature relation type\n")
242 SG_ERROR(
"Specified features are not of type CDotFeatures\n")
256 for (int32_t i=0; i<num; i++)
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 float64_t apply_one(int32_t vec_idx)
int32_t get_max_iter() const
void set_feature_relation(CIndexBlockRelation *feature_relation)
class IndexBlockGroup used to represent group-based feature relation.
CIndexBlockRelation * get_feature_relation() const
virtual SGVector< float64_t > get_SLEP_ind_t() const
class IndexBlockTree used to represent tree guided feature relation.
virtual bool train_machine(CFeatures *data=NULL)
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
void set_tolerance(float64_t tolerance)
CIndexBlockRelation * m_feature_relation
virtual int32_t get_num_vectors() const =0
SGVector< index_t > get_SLEP_ind()
virtual SGVector< float64_t > get_SLEP_G()
Features that support dot products among other operations.
virtual int32_t get_dim_feature_space() const =0
Class SGObject is the base class of all shogun objects.
void set_termination(int32_t termination)
virtual ~CFeatureBlockLogisticRegression()
virtual void set_features(CDotFeatures *feat)
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
void set_max_iter(int32_t max_iter)
slep_result_t slep_solver(CDotFeatures *features, double *y, double z, const slep_options &options)
all of classes and functions are contained in the shogun namespace
virtual EIndexBlockRelationType get_relation_type() const =0
float64_t get_tolerance() const
The class Features is the base class of all feature objects.
static float64_t exp(float64_t x)
Binary Labels for binary classification.
virtual SGVector< float64_t > apply_get_outputs(CFeatures *data)
virtual void set_bias(float64_t b)
int32_t get_termination() const
void set_regularization(int32_t regularization)
bool has_property(EFeatureProperty p) const
virtual void set_labels(CLabels *lab)
int32_t get_regularization() const
CFeatureBlockLogisticRegression()