aboutsummaryrefslogtreecommitdiff
path: root/interactionhandler.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-05-22 18:40:07 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-05-22 18:40:07 -0300
commit6a7b60784a44013156382843a5e72af272810674 (patch)
treef5cfea6392033e1d4e228eb0f388b343434994ce /interactionhandler.cpp
parente8bb632cae4e7c9a320a3412cbd487f859ae104c (diff)
Improvements to UI and performance.
Diffstat (limited to 'interactionhandler.cpp')
-rw-r--r--interactionhandler.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/interactionhandler.cpp b/interactionhandler.cpp
index 217f4a5..50d0653 100644
--- a/interactionhandler.cpp
+++ b/interactionhandler.cpp
@@ -6,26 +6,23 @@ InteractionHandler::InteractionHandler(const arma::mat &X,
const arma::vec &labels,
const arma::uvec &sampleIndices)
: m_X(X)
+ , m_Y(X.n_rows, 3)
, m_labels(labels)
, m_sampleIndices(sampleIndices)
, m_technique(TECHNIQUE_LAMP)
{
+ m_Y.col(2) = m_labels;
}
void InteractionHandler::setSubsample(const arma::mat &Ys)
{
- arma::mat embedding(m_X.n_rows, Ys.n_cols);
switch (m_technique) {
case TECHNIQUE_PLMP:
case TECHNIQUE_LSP:
case TECHNIQUE_LAMP:
- embedding = mp::lamp(m_X, m_sampleIndices, Ys);
+ mp::lamp(m_X, m_sampleIndices, Ys, m_Y);
break;
}
- arma::mat Y(embedding.n_rows, embedding.n_cols + 1);
- Y.cols(0, embedding.n_cols - 1) = embedding;
- Y.col(Y.n_cols - 1) = m_labels;
-
- emit subsampleChanged(Y);
+ emit subsampleChanged(m_Y);
}