22 #ifndef _SVMLight_H___
23 #define _SVMLight_H___
38 # define DEF_PRECISION 1E-14
39 # define MAXSHRINK 50000
41 #ifndef DOXYGEN_SHOULD_SKIP_THIS
47 int32_t at_upper_bound;
78 typedef struct quadratic_program {
100 typedef int32_t FNUM;
119 int32_t biased_hyperplane;
126 int32_t svm_maxqpsize;
128 int32_t svm_newvarsinqp;
130 int32_t kernel_cache_size;
136 int32_t svm_iter_to_shrink;
142 int32_t remove_inconsistent;
146 int32_t skip_final_opt_check;
210 int32_t *inactive_since;
222 #endif // DOXYGEN_SHOULD_SKIP_THIS
276 int32_t* docs, int32_t* label, int32_t totdoc, SHRINK_STATE *shrink_state,
278 TIMING *timing_profile,
float64_t *maxdiff, int32_t heldout,
315 int32_t
compute_index(int32_t *binfeature, int32_t range, int32_t *index);
336 int32_t* docs, int32_t* label, int32_t *exclude_from_eq_const,
337 float64_t eq_target, int32_t *chosen, int32_t *active2dnum, int32_t totdoc,
359 int32_t* docs, int32_t* label, int32_t *exclude_from_eq_const,
360 float64_t eq_target, int32_t *chosen, int32_t *active2dnum, int32_t *key,
382 int32_t* docs, int32_t* label, int32_t *exclude_from_eq_const,
383 float64_t eq_target, int32_t *chosen, int32_t *active2dnum, int32_t *key,
422 int32_t *inconsistent,int32_t* active2dnum, int32_t *last_suboptimal_at,
439 int32_t* docs, int32_t *label, int32_t *active2dnum,
float64_t *a,
462 int32_t* docs, int32_t *label, int32_t *active2dnum,
float64_t *a,
479 int32_t* docs, int32_t *label, int32_t *active2dnum,
float64_t *a,
505 int32_t qp_size, int32_t *inconsistent, int32_t* active2dnum,
506 int32_t* working2dnum,
float64_t *selcrit, int32_t *select,
507 int32_t cache_only, int32_t *key, int32_t *chosen);
529 int32_t totdoc, int32_t qp_size, int32_t *inconsistent,
530 int32_t *active2dnum, int32_t *working2dnum,
float64_t *selcrit,
531 int32_t *select, int32_t *key, int32_t *chosen, int32_t iteration);
541 float64_t *selcrit, int32_t range, int32_t *select, int32_t n);
550 SHRINK_STATE *shrink_state, int32_t totdoc, int32_t maxhistory);
574 SHRINK_STATE *shrink_state, int32_t *active2dnum,
575 int32_t *last_suboptimal_at, int32_t iteration, int32_t totdoc,
595 float64_t *c, int32_t totdoc,int32_t iteration, int32_t *inconsistent,
635 virtual const char*
get_name()
const {
return "SVMLight"; }
639 float64_t *threshold, int32_t& svm_maxqpsize);
690 #endif //USE_SVMLIGHT
691 #endif //_SVMLight_H___
void optimize_svm(int32_t *docs, int32_t *label, int32_t *exclude_from_eq_const, float64_t eq_target, int32_t *chosen, int32_t *active2dnum, int32_t totdoc, int32_t *working2dnum, int32_t varnum, float64_t *a, float64_t *lin, float64_t *c, float64_t *aicache, QP *qp, float64_t *epsilon_crit_target)
void select_top_n(float64_t *selcrit, int32_t range, int32_t *select, int32_t n)
int32_t select_next_qp_subproblem_rand(int32_t *label, float64_t *a, float64_t *lin, float64_t *c, int32_t totdoc, int32_t qp_size, int32_t *inconsistent, int32_t *active2dnum, int32_t *working2dnum, float64_t *selcrit, int32_t *select, int32_t *key, int32_t *chosen, int32_t iteration)
int32_t compute_index(int32_t *binfeature, int32_t range, int32_t *index)
static void * update_linear_component_linadd_helper(void *p)
virtual void update_linear_component(int32_t *docs, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *a_old, int32_t *working2dnum, int32_t totdoc, float64_t *lin, float64_t *aicache, float64_t *c)
static void * reactivate_inactive_examples_linadd_helper(void *p)
The class Labels models labels, i.e. class assignments of objects.
virtual void reactivate_inactive_examples(int32_t *label, float64_t *a, SHRINK_STATE *shrink_state, float64_t *lin, float64_t *c, int32_t totdoc, int32_t iteration, int32_t *inconsistent, int32_t *docs, float64_t *aicache, float64_t *maxdiff)
float64_t kernel(int32_t idx_a, int32_t idx_b)
virtual EMachineType get_classifier_type()
int32_t check_optimality(int32_t *label, float64_t *a, float64_t *lin, float64_t *c, int32_t totdoc, float64_t *maxdiff, float64_t epsilon_crit_org, int32_t *misclassified, int32_t *inconsistent, int32_t *active2dnum, int32_t *last_suboptimal_at, int32_t iteration)
static void * update_linear_component_mkl_linadd_helper(void *p)
void compute_matrices_for_optimization_parallel(int32_t *docs, int32_t *label, int32_t *exclude_from_eq_const, float64_t eq_target, int32_t *chosen, int32_t *active2dnum, int32_t *key, float64_t *a, float64_t *lin, float64_t *c, int32_t varnum, int32_t totdoc, float64_t *aicache, QP *qp)
void shrink_state_cleanup(SHRINK_STATE *shrink_state)
void add_to_index(int32_t *index, int32_t elem)
void update_linear_component_mkl(int32_t *docs, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *a_old, int32_t *working2dnum, int32_t totdoc, float64_t *lin, float64_t *aicache)
void compute_matrices_for_optimization(int32_t *docs, int32_t *label, int32_t *exclude_from_eq_const, float64_t eq_target, int32_t *chosen, int32_t *active2dnum, int32_t *key, float64_t *a, float64_t *lin, float64_t *c, int32_t varnum, int32_t totdoc, float64_t *aicache, QP *qp)
int32_t select_next_qp_subproblem_grad(int32_t *label, float64_t *a, float64_t *lin, float64_t *c, int32_t totdoc, int32_t qp_size, int32_t *inconsistent, int32_t *active2dnum, int32_t *working2dnum, float64_t *selcrit, int32_t *select, int32_t cache_only, int32_t *key, int32_t *chosen)
static void * compute_kernel_helper(void *p)
static void * reactivate_inactive_examples_vanilla_helper(void *p)
virtual float64_t compute_objective_function(float64_t *a, float64_t *lin, float64_t *c, float64_t *eps, int32_t *label, int32_t totdoc)
int32_t precision_violations
virtual bool train_machine(CFeatures *data=NULL)
float64_t * optimize_qp(QP *qp, float64_t *epsilon_crit, int32_t nx, float64_t *threshold, int32_t &svm_maxqpsize)
int32_t calculate_svm_model(int32_t *docs, int32_t *label, float64_t *lin, float64_t *a, float64_t *a_old, float64_t *c, int32_t *working2dnum, int32_t *active2dnum)
void clear_index(int32_t *index)
int32_t optimize_to_convergence(int32_t *docs, int32_t *label, int32_t totdoc, SHRINK_STATE *shrink_state, int32_t *inconsistent, float64_t *a, float64_t *lin, float64_t *c, TIMING *timing_profile, float64_t *maxdiff, int32_t heldout, int32_t retrain)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
void call_mkl_callback(float64_t *a, int32_t *label, float64_t *lin)
A generic Support Vector Machine Interface.
int32_t shrink_problem(SHRINK_STATE *shrink_state, int32_t *active2dnum, int32_t *last_suboptimal_at, int32_t iteration, int32_t totdoc, int32_t minshrink, float64_t *a, int32_t *inconsistent, float64_t *c, float64_t *lin, int *label)
void update_linear_component_mkl_linadd(int32_t *docs, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *a_old, int32_t *working2dnum, int32_t totdoc, float64_t *lin, float64_t *aicache)
virtual float64_t compute_kernel(int32_t i, int32_t j)
virtual const char * get_name() const
void init_shrink_state(SHRINK_STATE *shrink_state, int32_t totdoc, int32_t maxhistory)