25 #include <mlpack/methods/kmeans/kmeans.hpp> 41 QString new_name = FindUniqueName(name);
42 QSharedPointer<UnivariateData> univariate_data(
new UnivariateData(new_name));
43 univariate_data->Apply(left_bound, right_bound, bound_window,
data_,
abscissa_);
44 QStringList matrix_keys({
"Peak Centers",
46 "Adjusted Peak Intensities",
49 "Area Between Inflection Points",
50 "Adjusted Area Between Inflection Points",
51 "Empirical Full-Width at Half-Maximum"});
52 AddAnalysisResults(univariate_data, matrix_keys);
55 void MetaAnalyzer::FitPeak(
const QString &name,
const QString &peak_shape,
double &left_bound,
double &right_bound)
57 QSharedPointer<UnivariateData> univariate_data(
new UnivariateData(name));
58 univariate_data->Apply(peak_shape, left_bound, right_bound,
data_,
abscissa_);
59 QStringList matrix_keys;
60 if (peak_shape ==
"Voigt"){
61 matrix_keys = QStringList({
"Intensity",
63 "Gaussian Full-Width at Half Maximum",
64 "Lorentzian Full-Width at Half Maximum",
65 "Full-Width at Half Maximum",
70 matrix_keys = QStringList({
"Intensity",
72 "Full-Width at Half Maximum",
76 AddAnalysisResults(univariate_data, matrix_keys);
80 double &first_left_bound,
81 double &first_right_bound,
82 double &second_left_bound,
83 double &second_right_bound,
84 arma::uword bound_window)
86 QString new_name = FindUniqueName(name);
87 QSharedPointer<UnivariateData> univariate_data(
new UnivariateData(new_name));
88 univariate_data->Apply(first_left_bound, first_right_bound,
89 second_left_bound, second_right_bound,
91 QStringList matrix_keys({
"Band Ratios"});
92 AddAnalysisResults(univariate_data, matrix_keys);
97 QString new_name = FindUniqueName(name);
98 QSharedPointer<AnalysisResults> cls_results(
new AnalysisResults(new_name,
"CLS Analysis"));
99 mat reference =
workspace_->GetMatrix(reference_keys);
101 cls_results->AddMatrix(
"Coefficients", coefs.t());
102 AddAnalysisResults(cls_results, QStringList({
"Coefficients"}));
107 QString new_name = FindUniqueName(name);
108 QSharedPointer<VCAData> vca_data(
new VCAData(new_name));
109 vca_data->Apply(
data_, endmembers);
110 QStringList matrix_keys({
"Fractional Abundances"});
111 AddAnalysisResults(vca_data, matrix_keys);
115 const QString &metric_text,
const QString &partition_policy,
bool allow_empty,
118 QString new_name = FindUniqueName(name);
121 vec assignments = k.
Cluster(
data_, clusters, centroids);
123 QSharedPointer<AnalysisResults> km_results(
new AnalysisResults(new_name,
"k-Means Analysis"));
124 km_results->AddMatrix(
"Assignments", assignments);
125 km_results->AddMatrix(
"Centroids", centroids);
126 QStringList matrix_keys({
"Assignments"});
128 AddAnalysisResults(km_results, matrix_keys);
133 QString new_name = FindUniqueName(name);
135 pca_data->Apply(
data_);
136 QStringList matrix_keys({
"Scores",
"Hotelling t²"});
137 AddAnalysisResults(pca_data, matrix_keys);
142 QString new_name = FindUniqueName(name);
143 QSharedPointer<MlpackPCAData> pca_data(
new MlpackPCAData(new_name));
144 pca_data->Apply(
data_, scale_data);
145 AddAnalysisResults(pca_data, QStringList());
150 QString new_name = FindUniqueName(name);
151 QSharedPointer<PLSData> pls_data(
new PLSData(new_name));
153 QStringList matrices({
"Predictor Scores",
"Response Scores"});
154 AddAnalysisResults(pls_data, matrices);
159 QString new_name = FindUniqueName(name);
160 QSharedPointer<PLSData> pls_data(
new PLSData(new_name));
161 mat controls =
workspace_->GetMatrix(control_keys);
162 pls_data->Calibrate(
data_, controls);
163 QStringList matrices({
"Predictor Scores",
"Response Scores"});
164 AddAnalysisResults(pls_data, matrices);
169 QString new_name = FindUniqueName(name);
170 QSharedPointer<PLSData> pls_data(
new PLSData(new_name));
171 mat labels =
workspace_->GetMatrix(label_keys);
172 pls_data->Discriminate(
data_, labels);
173 QStringList matrices({
"Predictor Scores",
"Response Scores"});
174 AddAnalysisResults(pls_data, matrices);
179 QSharedPointer<AnalysisResults> ahca_results(
new AnalysisResults(name,
"AHCA"));
187 ahca_results->AddMatrix(
"Assignments", assignments);
188 ahca_results->AddMatrix(
"Spectrum Distances", ahca.
dist());
189 ahca_results->AddMatrix(
"Cluster Distances", ahca.
merge_data());
190 QStringList matrix_keys = QStringList({
"Assignments"});
191 AddAnalysisResults(ahca_results, matrix_keys);
The PLSData class A class for performing and storing data related to partial least squares determinan...
arma::vec Cluster(const arma::mat &data, const size_t clusters, arma::mat ¢roids)
The PrincipalComponentsData class A class for performing and storing data from principal components a...
void Link(const arma::mat &data)
Vespucci::Math::Clustering::AHCA::Link.
void SetLinkage(std::string linkage_method)
The KMeansWrapper class mlpack relies heavily on template metaprogramming. This means that you only n...
void SetMetric(std::string metric_type)
arma::mat Cluster(arma::uword k)
Vespucci::Math::Clustering::AHCA::Cluster Generate cluster assignments from tree. ...
The VCAData class A class for performing and storing data from Vertex Components Analysis.
The AnalysisResults class A container for a mat object that allows a mat to be copied to a heap-alloc...
VESPUCCI_EXPORT arma::mat OrdinaryLeastSquares(const arma::mat &X, const arma::mat &y)
Vespucci::Math::LinLeastSq::OrdinaryLeastSquares Perform Squares.
The AHCA class Handles agglomerative hierarchical clustering of data This class holds a tree which re...