34 lines
836 B
C++
34 lines
836 B
C++
#ifndef ARFFFILES_H
|
|
#define ARFFFILES_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
using namespace std;
|
|
|
|
class ArffFiles {
|
|
private:
|
|
vector<string> lines;
|
|
vector<pair<string, string>> attributes;
|
|
string className;
|
|
string classType;
|
|
vector<vector<float>> X;
|
|
vector<int> y;
|
|
void generateDataset(int);
|
|
void loadCommon(string);
|
|
public:
|
|
ArffFiles();
|
|
void load(const string&, bool = true);
|
|
void load(const string&, const string&);
|
|
vector<string> getLines() const;
|
|
unsigned long int getSize() const;
|
|
string getClassName() const;
|
|
string getClassType() const;
|
|
static string trim(const string&);
|
|
vector<vector<float>>& getX();
|
|
vector<int>& getY();
|
|
vector<pair<string, string>> getAttributes() const;
|
|
static vector<int> factorize(const vector<string>& labels_t);
|
|
};
|
|
|
|
#endif |