aboutsummaryrefslogtreecommitdiff
path: root/mp.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-07-24 13:01:16 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-07-24 13:01:16 -0300
commit6da67a32e56c101b9334d2c6f33bd5238d082330 (patch)
tree87d6f4dbc4b1d926be75c432ede2578ab45d8b33 /mp.h
parentb7e1060b7cb71b30b91cc65c011b719e255c0a06 (diff)
Color mapping in Scatterplot and initial measures.
- Scatterplot: can now map any floating point data to colors; - Scatterplot: somewhat optimized geometry/material updates; - Removed anything related to labels where it was not necessary; - Added observers to implement distortion (via measures) visualization; - Added skeleton implementations of NP and silhouette.
Diffstat (limited to 'mp.h')
-rw-r--r--mp.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/mp.h b/mp.h
index 7d6b535..a9ddd38 100644
--- a/mp.h
+++ b/mp.h
@@ -1,10 +1,21 @@
+#ifndef MP_H
+#define MP_H
+
#include <armadillo>
namespace mp {
+// --- Distance-related
+typedef double (*DistFunc)(const arma::rowvec &, const arma::rowvec &);
double euclidean(const arma::rowvec &x1, const arma::rowvec &x2);
-arma::mat dist(const arma::mat &X, double (*distCalc)(const arma::rowvec &, const arma::rowvec &) = euclidean);
+arma::mat dist(const arma::mat &X, DistFunc dfunc = euclidean);
+
+// --- Evaluation measures
+typedef arma::vec (*MeasureFunc)(const arma::mat &distA, const arma::mat &distB);
+arma::vec neighborhoodPreservation(const arma::mat &distA, const arma::mat &distB, int k = 10);
+arma::vec silhouette(const arma::mat &distA, const arma::mat &distB, const arma::vec &labels);
+// --- Techniques
arma::mat lamp(const arma::mat &X, const arma::uvec &sampleIndices, const arma::mat &Ys);
void lamp(const arma::mat &X, const arma::uvec &sampleIndices, const arma::mat &Ys, arma::mat &Y);
@@ -14,3 +25,5 @@ arma::mat tSNE(const arma::mat &X, arma::uword k = 2, double perplexity = 30, ar
void tSNE(const arma::mat &X, arma::mat &Y, double perplexity = 30, arma::uword nIter = 1000);
} // namespace mp
+
+#endif // MP_H