Skip to content

Commit 34ba115

Browse files
committed
Refactor training dataset file path creator
1 parent 1964d20 commit 34ba115

File tree

1 file changed

+18
-3
lines changed
  • swan-pipeline/src/main/java/de/fraunhofer/iem/swan/cli

1 file changed

+18
-3
lines changed

swan-pipeline/src/main/java/de/fraunhofer/iem/swan/cli/SwanCli.java

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package de.fraunhofer.iem.swan.cli;
22

33
import de.fraunhofer.iem.swan.SwanPipeline;
4+
import de.fraunhofer.iem.swan.model.ModelEvaluator;
45
import org.slf4j.Logger;
56
import org.slf4j.LoggerFactory;
67

@@ -43,11 +44,25 @@ public Integer run(SwanOptions options) throws Exception {
4344

4445
List<String> instances = new ArrayList<>();
4546

47+
String dataset = "";
48+
49+
switch (ModelEvaluator.Toolkit.valueOf(options.getToolkit().toUpperCase())) {
50+
51+
case MEKA:
52+
dataset = options.getToolkit();
53+
break;
54+
case WEKA:
55+
case MLPLAN:
56+
case AUTOWEKA:
57+
dataset = "weka";
58+
break;
59+
}
60+
4661
for (String feature : options.getFeatureSet()) {
47-
String filepath = File.separator + "dataset" + File.separator + options.getToolkit() + File.separator + feature;
62+
String filepath = File.separator + "dataset" + File.separator + dataset
63+
+ File.separator + feature;
4864

4965
ArrayList<String> files = new ArrayList<>();
50-
5166
for (File f : Objects.requireNonNull(fileUtility.getResourceDirectory(filepath).listFiles())) {
5267
files.add(f.getAbsolutePath());
5368
}
@@ -56,7 +71,7 @@ public Integer run(SwanOptions options) throws Exception {
5671
options.setInstances(instances);
5772
}
5873

59-
logger.info("SWAN options: {}", options);
74+
logger.info("Configuring SWAN with {}", options);
6075

6176
try {
6277
swanPipeline = new SwanPipeline(options);

0 commit comments

Comments
 (0)