pmlpp/mlpp/knn/knn.h

34 lines
654 B
C
Raw Normal View History

2023-01-24 18:57:18 +01:00
#ifndef MLPP_KNN_H
#define MLPP_KNN_H
//
// kNN.hpp
//
// Created by Marc Melikyan on 10/2/20.
//
#include <vector>
2023-01-24 19:20:18 +01:00
2023-01-25 00:25:18 +01:00
class MLPPKNN {
2023-01-24 19:00:54 +01:00
public:
2023-01-25 00:25:18 +01:00
MLPPKNN(std::vector<std::vector<double>> inputSet, std::vector<double> outputSet, int k);
2023-01-24 19:00:54 +01:00
std::vector<double> modelSetTest(std::vector<std::vector<double>> X);
int modelTest(std::vector<double> x);
double score();
private:
// Private Model Functions
std::vector<double> nearestNeighbors(std::vector<double> x);
int determineClass(std::vector<double> knn);
// Model Inputs and Parameters
std::vector<std::vector<double>> inputSet;
std::vector<double> outputSet;
int k;
};
2023-01-24 19:20:18 +01:00
#endif /* kNN_hpp */