9 #ifndef KNNCLASSIFICATION_H
10 #define KNNCLASSIFICATION_H
16 #include "../dependencies/json/json.h"
31 const std::vector<size_t> &which_inputs,
40 void addNeighbour(
const int &classNum,
const std::vector<T> &features);
46 T
run(
const std::vector<T> &inputVector)
override;
63 void reset()
override;
91 std::vector<size_t> whichInputs;
92 std::size_t whichOutput;
93 std::vector<trainingExampleTemplate<T>> neighbours;
96 inline void updateK();
Definition: baseModel.h:42
Definition: knnClassification.h:22
std::vector< size_t > getWhichInputs() const override
Definition: knnClassification.cpp:49
void getJSONDescription(Json::Value ¤tModel) override
Definition: knnClassification.cpp:185
void reset() override
Definition: knnClassification.cpp:37
int getK() const
Definition: knnClassification.cpp:55
~knnClassification()
Definition: knnClassification.cpp:34
void addNeighbour(const int &classNum, const std::vector< T > &features)
Definition: knnClassification.cpp:74
void setK(int newK)
Definition: knnClassification.cpp:67
size_t getNumInputs() const override
Definition: knnClassification.cpp:43
T run(const std::vector< T > &inputVector) override
Definition: knnClassification.cpp:100
void train(const std::vector< trainingExampleTemplate< T > > &trainingSet) override
Definition: knnClassification.cpp:84
knnClassification(const int &num_inputs, const std::vector< size_t > &which_inputs, const std::vector< trainingExampleTemplate< T > > &trainingSet, const int k)
Definition: knnClassification.cpp:20
Definition: trainingExample.h:19