Split print function into three pieces

This commit is contained in:
Trianta 2024-04-17 14:43:47 -05:00
parent 42daff8a4c
commit c49d160bd5
4 changed files with 17 additions and 4 deletions

View File

@ -81,11 +81,16 @@ namespace ARFF {
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 << database.size() << " examples\n";
std::cout << std::endl;
}
// Print full data information
void Arff::PrintData(void) {
std::cout << "Attribute (#): values\n";
for (AttributeType type : attributeList) {
std::cout << type.attribute << " (" << type.values.size() << "):";
@ -107,6 +112,11 @@ namespace ARFF {
std::cout << std::endl;
}
// Print result of applying OneR
// TODO: Create function
void PrintOneR(void) {
}
// Add the attribute to the list
void Arff::AddAttribute(std::string line) {
std::stringstream parser(line);

View File

@ -29,7 +29,9 @@ namespace ARFF {
public:
Arff() = default;
void Read(std::string filename);
void Print(void);
void PrintOverview(void);
void PrintData(void);
void PrintOneR(void);
private:
std::string relation;
std::vector<AttributeType> attributeList;

View File

@ -9,5 +9,6 @@ int main(int argc, char* argv[]) {
ARFF::ParseArguments(argc, argv);
ARFF::Arff data;
data.Read(ARFF::GetDataFilename());
data.Print();
data.PrintOverview();
data.PrintData();
}

View File

@ -9,5 +9,5 @@ int main(int argc, char* argv[]) {
ARFF::ParseArguments(argc, argv);
ARFF::Arff data;
data.Read(ARFF::GetDataFilename());
data.Print();
data.PrintOverview();
}