4 #define LIBSVM_VERSION 289
10 using namespace KKMLL;
95 void Cost (
double _cost) {
C = _cost;}
174 void Write (ostream& o);
176 void Read (istream& i,
240 double* prob_estimates,
265 template <
class T>
inline void swap(T& x, T& y) {
T t=
x;
x=
y;
y=
t; }
274 template <
class S,
class T>
inline void clone(T*& dst, S* src,
kkint32 n)
void SvmType(SVM_Type _svm_type)
void KernalType(Kernel_Type _kernalType)
svm_parameter & operator=(const svm_parameter &right)
KKStr ToCmdLineStr() const
svm_model(const svm_model &_model, FileDescPtr _fileDesc, RunLog &_log)
Keeps track of selected features.
kkint32 svm_check_probability_model(const struct svm_model *model)
Namespace used to wrap implementation of libSVM version 2.89 to be used as a pair-wise SVM...
KKStr SVM_Type_ToStr(SVM_Type svmType)
KKStr Kernel_Type_ToStr(Kernel_Type kernelType)
svm_model(const svm_parameter &_param, const FeatureNumList &_selFeatures, FileDescPtr _fileDesc, RunLog &_log)
FeatureNumList selFeatures
static const char * svm_type_table[]
void svm_get_labels(const svm_model *model, kkint32 *label)
void clone(T *&dst, S *src, kkint32 n)
Kernel_Type Kernel_Type_FromStr(KKStr s)
static const char * kernel_type_table[]
void svm_predict_values(const svm_model *model, const FeatureVector &x, double *dec_values)
svm_problem(const svm_problem &_prob)
void ProcessSvmParameter(const KKStr &cmd, const KKStr &value, bool &parmUsed)
double svm_predict_probability(svm_model *model, const FeatureVector &x, double *prob_estimates, kkint32 *votes)
void Read(istream &i, FileDescPtr fileDesc, RunLog &log)
kkint32 svm_get_nr_class(const svm_model *model)
Container class for FeatureVector derived objects.
svm_model(istream &_fileName, FileDescPtr _fileDesc, RunLog &_log)
void svm_destroy_param(struct svm_parameter *¶m)
void Gamma(double _gamma)
svm_parameter(const svm_parameter &_param)
KKStr ToTabDelStr() const
FileDescPtr FileDesc() const
double powi(double base, kkint32 times)
void ParseTabDelStr(const KKStr &_str)
double svm_predict(const struct svm_model *model, const FeatureVector &x)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
void NormalizeProbability()
Derining multiclass probability as done in "Recognizing Plankton Images From the SIPPER".
svm_problem(const FeatureVectorList &_x, const float *_y, const FeatureNumList &_selFeatures)
svm_model * svm_train(const svm_problem &prob, const svm_parameter ¶m, RunLog &log)
SVM_Type svm_get_svm_type(const svm_model *model)
svm_parameter(KKStr ¶mStr)
void svm_destroy_model(struct svm_model *&model)
SVM_Type SVM_Type_FromStr(KKStr s)
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
svm_model(FileDescPtr _fileDesc, RunLog &_log)
Kernel_Type KernalType() const
FeatureNumList selFeatures
const char * svm_check_parameter(const struct svm_problem *prob, const struct svm_parameter *param)
Represents a Feature Vector of a single example, labeled or unlabeled.
void(* svm_print_string)(const char *)
svm_problem(const FeatureNumList &_selFeatures, FileDescPtr _fileDesc, RunLog &_log)
double svm_get_svr_probability(const svm_model *model)
const FeatureNumList & SelFeatures() const