forked from Yiqing-Gu/Pidentify
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprocess.h
More file actions
23 lines (19 loc) · 1.06 KB
/
process.h
File metadata and controls
23 lines (19 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef PROCESS_H
#define PROCESS_H
#include "classMember.h"
#include <vector>
#include <unordered_map>
#include <string>
#include <ap.h>
std::unordered_map<std::string, std::vector<double> > process(std::unordered_map<std::string,
std::vector<ClassMember>> & dataset, int numNeighborsChecked, int minSameClassCount, size_t iteration);
double euclideanDistance(const std::vector<double>& a, const std::vector<double>& b);
double weightedEuclideanDistance(const std::vector<double>& a, const std::vector<double>& b, const std::vector<double>& weights);
void removeFeatures(const std::vector<size_t>& indices, std::vector<ClassMember>& dataset);
void projectOntoPrincipalAxes(const alglib::real_2d_array& datapoints, const alglib::real_2d_array& principalAxes,
alglib::real_2d_array& principalComponents);
std::unordered_map<std::string, std::vector<double> > computeNearestNeighborDistances(
const std::unordered_map<std::string, std::vector<std::vector<double> > >& classMap);
constexpr size_t MIN_PCA_BASIS = 2;
constexpr double MIN_PCA_BASIS_VARIANCE = 0.5;
#endif