2024-03-18 19:19:47 -05:00
|
|
|
#ifndef ARFF_HPP
|
|
|
|
#define ARFF_HPP
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace ARFF {
|
|
|
|
void ParseArguments(int argc, char* argv[]);
|
|
|
|
std::string GetDataFilename(void);
|
|
|
|
|
|
|
|
struct AttributeType {
|
|
|
|
public:
|
|
|
|
std::string attribute;
|
|
|
|
std::vector<std::string> values;
|
|
|
|
AttributeType(std::string attribute);
|
|
|
|
void AddValue(std::string value);
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Instance {
|
|
|
|
public:
|
|
|
|
Instance(const int id, const int size);
|
|
|
|
unsigned int id;
|
|
|
|
std::vector<std::string> values;
|
|
|
|
};
|
|
|
|
|
|
|
|
class Arff {
|
|
|
|
public:
|
|
|
|
Arff() = default;
|
|
|
|
void Read(std::string filename);
|
2024-04-17 14:43:47 -05:00
|
|
|
void PrintOverview(void);
|
|
|
|
void PrintData(void);
|
|
|
|
void PrintOneR(void);
|
2024-03-18 19:19:47 -05:00
|
|
|
private:
|
|
|
|
std::string relation;
|
|
|
|
std::vector<AttributeType> attributeList;
|
|
|
|
std::vector<Instance> database;
|
|
|
|
void AddAttribute(std::string line);
|
|
|
|
void AddData(std::string line);
|
|
|
|
void TestIntegrity(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|