Skip to content
Snippets Groups Projects
Unverified Commit 299e8e56 authored by BARBIER Marc's avatar BARBIER Marc
Browse files

fix discretisation with multiple columns

parent 259fef79
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,8 @@ import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import org.apache.commons.io.FileUtils;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
......@@ -450,6 +452,11 @@ public class ArffDenseUtils {
if(!tempFile.getPath().equals(outputFile.getPath())){
tempFile.renameTo(outputFile);
}
//if the input and output are the same we need to copy tempFile
if(outputFile.getPath().equals(file.getPath())){
FileUtils.copyFile(tempFile, outputFile);
}
timer.end();
}
......
......@@ -23,6 +23,7 @@ import java.util.TreeSet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.io.FileUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.type.TypeReference;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -355,6 +356,7 @@ public class TransformController extends AbstractController{
File input = currentInput.getFile();
List<Map<String,String>> stats = ArffStatistics.getAllAttributeStatisticsFast(input);
for(String name: columnsArr) {
System.out.println(name);
int idx = names.indexOf(name);
final double min = Double.parseDouble(stats.get(idx).get("min"));
final double max = Double.parseDouble(stats.get(idx).get("max"));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment