8 #define LIBSVM_VERSION 289
16 using namespace KKMLL;
53 FileDescPtr _fileDesc,
109 void Cost (
double _cost) {
C = _cost;}
165 FileDescPtr _fileDesc
172 FileDescPtr _fileDesc
263 double* prob_estimates,
283 template <
class T>
inline void swap(T& x, T& y) { T t=x; x=y; y=t; }
292 template <
class S,
class T>
inline void clone(T*& dst, S* src,
kkint32 n)
296 kkint32 sizeOfT =
sizeof(T);
297 KKStr::MemCpy ((
void *)dst, (
void *)src, sizeOfT * n);
double svm_predict_probability(Svm_Model *model, const FeatureVector &x, double *prob_estimates, kkint32 *votes)
void Gamma(double _gamma)
Svm_Model * svm_train(const svm_problem &prob, const svm_parameter ¶m, RunLog &log)
FileDescPtr FileDesc() const
kkint32 svm_get_svm_type(const struct Svm_Model *model)
Keeps track of selected features.
void clone(T *&dst, S *src, kkint32 n)
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
kkint32 svm_check_probability_model(const struct Svm_Model *model)
FeatureNumList selFeatures
Svm_Model(const Svm_Model &_model, FileDescPtr _fileDesc)
double svm_get_svr_probability(const struct Svm_Model *model)
void(* svm_print_string)(const char *)
KKStr Kernel_Type_ToStr(Kernel_Type kernelType)
Svm_Model(FileDescPtr _fileDesc)
Container class for FeatureVector derived objects.
double svm_predict(const struct Svm_Model *model, const FeatureVector &x)
void ParseTabDelStr(const KKStr &_str)
svm_parameter(const svm_parameter &_param)
double powi(double base, kkint32 times)
KKStr ToCmdLineStr() const
Kernel_Type KernalType() const
XmlTag const * XmlTagConstPtr
FeatureNumList selFeatures
void NormalizeProbability()
Derives multi-class probability.
SVM_Type SVM_Type_FromStr(KKStr s)
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
XmlElementSvm_Model * XmlElementSvm_ModelPtr
void ProcessSvmParameter(const KKStr &cmd, const KKStr &value, bool &parmUsed)
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
void svm_destroy_model(struct Svm_Model *&model)
KKStr ToTabDelStr() const
kkint32 svm_get_nr_class(const struct Svm_Model *model)
Kernel_Type Kernel_Type_FromStr(KKStr s)
Svm_Model(const svm_parameter &_param, const FeatureNumList &_selFeatures, FileDescPtr _fileDesc)
const char * svm_check_parameter(const struct svm_problem *prob, const struct svm_parameter *param)
static const char * kernel_type_table[]
void svm_destroy_param(struct svm_parameter *¶m)
svm_problem(const FeatureVectorList &_x, const float *_y, const FeatureNumList &_selFeatures)
kkint32 MemoryConsumedEstimated() const
svm_parameter & operator=(const svm_parameter &right)
svm_problem(const FeatureNumList &_selFeatures, FileDescPtr _fileDesc, RunLog &_log)
Used for logging messages.
void EncodeProblem(const struct svm_paramater ¶m, struct svm_problem &prob_in, struct svm_problem &prob_out)
const FeatureNumList & SelFeatures() const
void svm_get_labels(const struct Svm_Model *model, kkint32 *label)
void CancelFlag(bool cancelFlag)
KKStr SVM_Type_ToStr(SVM_Type svmType)
virtual void WriteXML(const KKStr &varName, ostream &o) const
svm_parameter(KKStr ¶mStr)
Represents a Feature Vector of a single example, labeled or unlabeled.
void KernalType(Kernel_Type _kernalType)
static const char * svm_type_table[]
XmlElementTemplate< Svm_Model > XmlElementSvm_Model
svm_problem(const svm_problem &_prob)
void SvmType(SVM_Type _svm_type)
volatile const bool VolConstBool
void svm_predict_values(const Svm_Model *model, const FeatureVector &x, double *dec_values)