Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,863 changes: 2,863 additions & 0 deletions Doxyfile

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions include/mlcpppy/classifiers/classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@
*/
#ifndef CLASSIFIER_H
#define CLASSIFIER_H

#include <vector>

class Classifier {
public:
virtual void train() = 0;
virtual int predict() = 0;
virtual ~Classifier() {}
virtual void Train() = 0;
virtual std::vector<double> Predict() = 0;
virtual ~Classifier() = default;
};
#endif // CLASSIFIER_H
3 changes: 3 additions & 0 deletions include/mlcpppy/classifiers/knn.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ class KNN : Classifier {
public:
KNN(/* args */);
~KNN();

void Train();
std::vector<double> Predict();
};
#endif // KNN_H
28 changes: 28 additions & 0 deletions include/mlcpppy/classifiers/stream_classifier.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (C) 2025 Pedro Bianchini de Quadros
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef STREAM_CLASSIFIER_H
#define STREAM_CLASSIFIER_H

#include <vector>

class StreamClassifier {
public:
virtual void Train() = 0;
virtual std::vector<double> Predict() = 0;
virtual ~StreamClassifier() = default;
};
#endif // STREAM_CLASSIFIER_H
37 changes: 37 additions & 0 deletions include/mlcpppy/instances/attribute.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (C) 2025 Pedro Bianchini de Quadros
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef ATTRIBUTE_H
#define ATTRIBUTE_H
#include <string>
#include <variant>
#include <vector>

class Attribute
{
public:
using ValueType = std::variant<int, double, float, std::string>;
Attribute(int v) : value(v) {}
Attribute(double v) : value(v) {}
Attribute(const std::string& v) : value(v) {}
const ValueType& getValue() const { return value; }
~Attribute();
private:
/* data */
ValueType value;
};

#endif // ATTRIBUTE_H
31 changes: 31 additions & 0 deletions include/mlcpppy/instances/instance.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2025 Pedro Bianchini de Quadros
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef INSTANCE_H
#define INSTANCE_H

#include <vector>
#include "attribute.h"

class Instance
{
private:
std::vector<Attribute> values_instance_;
public:
Instance(/* args */);
};

#endif // INSTANCE_H
34 changes: 34 additions & 0 deletions include/mlcpppy/instances/instances.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (C) 2025 Pedro Bianchini de Quadros
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef INSTANCES_H
#define INSTANCES_H

#include <vector>

#include "instance.h"

class Instances
{
private:
/* data */
std::vector<Instance> instances_data_;
public:
Instances(/* args */);
~Instances();
};

#endif // INSTANCES_H
Loading