add oneR to main #2
@ -81,11 +81,16 @@ namespace ARFF {
|
|||||||
TestIntegrity();
|
TestIntegrity();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Arff::Print(void) {
|
// Print generic data information
|
||||||
|
// Number of attributes and size of database
|
||||||
|
void Arff::PrintOverview(void) {
|
||||||
std::cout << attributeList.size() << " attributes\n";
|
std::cout << attributeList.size() << " attributes\n";
|
||||||
std::cout << database.size() << " examples\n";
|
std::cout << database.size() << " examples\n";
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print full data information
|
||||||
|
void Arff::PrintData(void) {
|
||||||
std::cout << "Attribute (#): values\n";
|
std::cout << "Attribute (#): values\n";
|
||||||
for (AttributeType type : attributeList) {
|
for (AttributeType type : attributeList) {
|
||||||
std::cout << type.attribute << " (" << type.values.size() << "):";
|
std::cout << type.attribute << " (" << type.values.size() << "):";
|
||||||
@ -107,6 +112,11 @@ namespace ARFF {
|
|||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print result of applying OneR
|
||||||
|
// TODO: Create function
|
||||||
|
void PrintOneR(void) {
|
||||||
|
}
|
||||||
|
|
||||||
// Add the attribute to the list
|
// Add the attribute to the list
|
||||||
void Arff::AddAttribute(std::string line) {
|
void Arff::AddAttribute(std::string line) {
|
||||||
std::stringstream parser(line);
|
std::stringstream parser(line);
|
||||||
|
@ -29,7 +29,9 @@ namespace ARFF {
|
|||||||
public:
|
public:
|
||||||
Arff() = default;
|
Arff() = default;
|
||||||
void Read(std::string filename);
|
void Read(std::string filename);
|
||||||
void Print(void);
|
void PrintOverview(void);
|
||||||
|
void PrintData(void);
|
||||||
|
void PrintOneR(void);
|
||||||
private:
|
private:
|
||||||
std::string relation;
|
std::string relation;
|
||||||
std::vector<AttributeType> attributeList;
|
std::vector<AttributeType> attributeList;
|
||||||
|
@ -9,5 +9,6 @@ int main(int argc, char* argv[]) {
|
|||||||
ARFF::ParseArguments(argc, argv);
|
ARFF::ParseArguments(argc, argv);
|
||||||
ARFF::Arff data;
|
ARFF::Arff data;
|
||||||
data.Read(ARFF::GetDataFilename());
|
data.Read(ARFF::GetDataFilename());
|
||||||
data.Print();
|
data.PrintOverview();
|
||||||
|
data.PrintData();
|
||||||
}
|
}
|
||||||
|
@ -9,5 +9,5 @@ int main(int argc, char* argv[]) {
|
|||||||
ARFF::ParseArguments(argc, argv);
|
ARFF::ParseArguments(argc, argv);
|
||||||
ARFF::Arff data;
|
ARFF::Arff data;
|
||||||
data.Read(ARFF::GetDataFilename());
|
data.Read(ARFF::GetDataFilename());
|
||||||
data.Print();
|
data.PrintOverview();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user