46 using namespace shogun;
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)