72 SG_DEBUG(
"set new distance (%p).\n", dist)
91 if (!strncmp(target,
"TRAIN", 5))
93 CFeatures* train=
ui->ui_features->get_train_features();
98 if ((d_fclass==fclass || d_fclass==
C_ANY || fclass==
C_ANY) &&
99 (d_ftype==ftype || d_ftype==
F_ANY || ftype==
F_ANY))
106 SG_ERROR(
"Distance can not process this train feature type: %d %d.\n", fclass, ftype)
109 SG_ERROR(
"Assign train features first.\n")
111 else if (!strncmp(target,
"TEST", 4))
113 CFeatures* train=
ui->ui_features->get_train_features();
114 CFeatures* test=
ui->ui_features->get_test_features();
119 if ((d_fclass==fclass || d_fclass==
C_ANY || fclass==
C_ANY) &&
120 (d_ftype==ftype || d_ftype==
F_ANY || ftype==
F_ANY))
124 SG_ERROR(
"Distance not initialized with training examples.\n")
127 SG_INFO(
"Initialising distance with TEST DATA, train: %p test %p\n", train, test)
133 SG_ERROR(
"Distance can not process this test feature type: %d %d.\n", fclass, ftype)
136 SG_ERROR(
"Assign train and test features first.\n")
151 char filename[1024]=
"";
155 if ((sscanf(param,
"%s", filename))==1)
164 SG_ERROR(
"writing to file %s failed!\n", filename)
167 SG_INFO(
"successfully written distance to \"%s\" !\n", filename)
175 SG_ERROR(
"no distance set / distance not initialized!\n")
212 SG_ERROR(
"Unknown metric/distance type %d given to create generic distance/metric.\n", type)
216 SG_INFO(
"Metric/Distance of type %d created (%p).\n", type, dist)
218 SG_ERROR(
"Failed creating metric of type %d.\n", type)
227 SG_INFO(
"Minkowski Metric created (%p), k %f.\n", dist, k)
229 SG_ERROR(
"Failed Creating Minkowski Metric, k %f.\n", k)
239 SG_INFO(
"HammingWord distance created (%p), use sign %d.\n",
243 SG_ERROR(
"Failed Creating HammingWord distance, use sign %d.\n", use_sign)
class HammingWordDistance
virtual EFeatureClass get_feature_class()=0
Class Distance, a base class for all the distances used in the Shogun toolbox.
class SparseEucldeanDistance
bool save_distance(char *param)
CDistance * create_hammingword(bool use_sign=false)
#define SG_NOTIMPLEMENTED
class Tanimoto coefficient
class ManhattanWordDistance
CDistance * get_distance()
EFeatureClass
shogun feature class
Class CSVFile used to read data from comma-separated values (CSV) files. See http://en.wikipedia.org/wiki/Comma-separated_values.
virtual void set_precompute_matrix(bool flag)
Class SGObject is the base class of all shogun objects.
CDistance * create_generic(EDistanceType type)
virtual EFeatureClass get_feature_class() const =0
EFeatureType
shogun feature type
class Bray-Curtis distance
bool set_distance(CDistance *dist)
all of classes and functions are contained in the shogun namespace
bool init_distance(const char *target)
The class Features is the base class of all feature objects.
virtual EFeatureType get_feature_type()=0
class CanberraWordDistance
virtual bool init(CFeatures *lhs, CFeatures *rhs)
virtual EFeatureType get_feature_type() const =0
CDistance * create_minkowski(float64_t k=3)