BayesNet/lib/Files/ArffFiles.h

32 lines
969 B
C
Raw Normal View History

2023-06-29 20:00:41 +00:00
#ifndef ARFFFILES_H
#define ARFFFILES_H
#include <string>
#include <vector>
class ArffFiles {
private:
2023-11-08 17:45:35 +00:00
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;
2023-07-26 23:56:06 +00:00
void generateDataset(int);
2023-11-08 17:45:35 +00:00
void loadCommon(std::string);
2023-06-29 20:00:41 +00:00
public:
ArffFiles();
2023-11-08 17:45:35 +00:00
void load(const std::string&, bool = true);
void load(const std::string&, const std::string&);
std::vector<std::string> getLines() const;
2023-06-29 20:00:41 +00:00
unsigned long int getSize() const;
2023-11-08 17:45:35 +00:00
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);
2023-06-29 20:00:41 +00:00
};
#endif