Return File Library to /lib as it is needed by Local Discretization (factorize)

This commit is contained in:
2024-04-30 20:31:14 +02:00
parent 7aeffba740
commit 618a1e539c
148 changed files with 1804 additions and 1769 deletions

33
lib/Files/ArffFiles.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef ARFFFILES_H
#define ARFFFILES_H
#include <string>
#include <vector>
class ArffFiles {
public:
ArffFiles() = default;
void load(const std::string&, bool = true);
void load(const std::string&, const std::string&);
std::vector<std::string> getLines() const;
unsigned long int getSize() const;
std::string getClassName() const;
std::string getClassType() const;
static std::string trim(const std::string&);
std::vector<std::vector<float>>& getX();
std::vector<int>& getY();
std::vector<std::pair<std::string, std::string>> getAttributes() const;
static std::vector<int> factorize(const std::vector<std::string>& labels_t);
protected:
std::vector<std::string> lines;
std::vector<std::pair<std::string, std::string>> attributes;
std::string className;
std::string classType;
std::vector<std::vector<float>> X;
std::vector<int> y;
int maxLines = 0;
void generateDataset(int);
void loadCommon(const std::string&);
};
#endif