MetricKnn API
Fast Similarity Search using the Metric Space Approach
mknn_predefined_distance.hpp
1 /*
2  * Copyright (C) 2012-2015, Juan Manuel Barrios <juanmanuel@barrios.cl>
3  * All rights reserved.
4  *
5  * This file is part of MetricKnn.
6  * MetricKnn is made available under the terms of the BSD 2-Clause License.
7  */
8 
9 #ifndef MKNN_PREDEFINED_DISTANCE_HPP_
10 #define MKNN_PREDEFINED_DISTANCE_HPP_
11 
12 #include "../metricknn_cpp.hpp"
13 
14 namespace mknn {
15 
31 public:
39  static void helpListDistances();
40 
46  static void helpPrintDistance(std::string id_dist);
47 
54  static bool testDistanceId(std::string id_dist);
55 
72  static DistanceParams L1();
73 
86  static DistanceParams L2();
87 
100  static DistanceParams Lmax();
101 
116  static DistanceParams Lp(double order);
117 
130  static DistanceParams Hamming();
131 
146  static DistanceParams Chi2();
147 
160  static DistanceParams Hellinger();
161 
177  static DistanceParams CosineSimilarity(bool normalize_vectors);
178 
195  static DistanceParams CosineDistance(bool normalize_vectors);
196 
212  static DistanceParams EMD(long long matrix_rows, long long matrix_cols,
213  double *cost_matrix, bool normalize_vectors);
214 
233  static DistanceParams DPF(double order, long long num_dims_discard,
234  double pct_discard, double threshold_discard);
235 
253  const std::vector<Distance> &subdistances,
254  bool free_subdistances_on_release,
255  const std::vector<double> &normalization_values,
256  const std::vector<double> &ponderation_values,
257  bool with_auto_config, Dataset &auto_config_dataset,
258  double auto_normalize_alpha, bool auto_ponderation_maxrho,
259  bool auto_ponderation_maxtau);
260 
261 };
262 
263 }
264 
265 #endif
Stores parameters in an internal map, which associates a names with its value.
Definition: mknn_params.hpp:21
MetricKnn provides a set of pre-defined distances.
Definition: mknn_predefined_distance.hpp:30
static DistanceParams Lmax()
Creates an object for L-max distance.
static bool testDistanceId(std::string id_dist)
Tests whether the given string references a valid pre-defined distance.
static DistanceParams EMD(long long matrix_rows, long long matrix_cols, double *cost_matrix, bool normalize_vectors)
Creates an object for Earth Mover's Distance.
static DistanceParams CosineSimilarity(bool normalize_vectors)
Creates an object for Cosine Similarity.
Represents a set of objects of any type.
Definition: mknn_dataset.hpp:23
static DistanceParams L2()
Creates an object for Euclidean distance.
static DistanceParams Chi2()
Creates an object for Chi2 distance.
static DistanceParams MultiDistance(const std::vector< Distance > &subdistances, bool free_subdistances_on_release, const std::vector< double > &normalization_values, const std::vector< double > &ponderation_values, bool with_auto_config, Dataset &auto_config_dataset, double auto_normalize_alpha, bool auto_ponderation_maxrho, bool auto_ponderation_maxtau)
Defines a multi-distance, which is a weighted combination of distances.
static void helpPrintDistance(std::string id_dist)
Prints to standard output the help for a distance.
static DistanceParams CosineDistance(bool normalize_vectors)
Creates an object for Cosine Distance.
Definition: mevaluation_answers.hpp:18
static DistanceParams L1()
Creates an object for Manhattan or Taxi-cab distance.
static DistanceParams Lp(double order)
Creates an object for Minkowski distance.
static DistanceParams Hamming()
Creates an object for Hamming distance.
static void helpListDistances()
Lists to standard output all pre-defined distances.
static DistanceParams Hellinger()
Creates an object for Hellinger distance.
static DistanceParams DPF(double order, long long num_dims_discard, double pct_discard, double threshold_discard)
Creates an object for Dynamic Partial Function distance.
Powered by Download MetricKnn