Fix a Linux problem in Datasets

This commit is contained in:
Ricardo Montañana Gómez 2023-09-30 18:43:47 +02:00
parent fd04e78ad9
commit 294666c516
Signed by: rmontanana
GPG Key ID: 46064262FD9A7ADE
2 changed files with 4 additions and 5 deletions

View File

@ -16,11 +16,10 @@ namespace platform {
vector<string> tokens = Dataset::split(line, ','); vector<string> tokens = Dataset::split(line, ',');
string name = tokens[0]; string name = tokens[0];
string className; string className;
try { if (tokens.size() == 1) {
className = tokens[1];
}
catch (exception e) {
className = "-1"; className = "-1";
} else {
className = tokens[1];
} }
datasets[name] = make_unique<Dataset>(path, name, className, discretize, fileType); datasets[name] = make_unique<Dataset>(path, name, className, discretize, fileType);
} }

View File

@ -43,7 +43,7 @@ namespace platform {
} }
std::string get(const std::string& key) std::string get(const std::string& key)
{ {
return env[key]; return env.at(key);
} }
std::vector<int> getSeeds() std::vector<int> getSeeds()
{ {