Commit b14022b0 authored by lafabregue's avatar lafabregue

Resolved merge conflicts

parents 409682f0 81816bb8
......@@ -24,14 +24,11 @@ import jcl.clustering.constraints.Constraint;
import jcl.clustering.constraints.MustLinkConstraint;
import jcl.data.Data;
import jcl.data.Model;
import jcl.data.SimpleData;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.Distance;
import jcl.data.distance.DistanceParameter;
import jcl.data.distance.EmptyDistanceParameter;
import jcl.data.distance.MetaDistance;
import jcl.data.distance.MetaDistanceEuclidean;
import jcl.data.distance.NumericalEuclideanDistance;
import jcl.data.distance.sequential.ParameterDTW;
import jcl.data.mask.IntArrayMask;
import jcl.data.mask.Mask;
......@@ -52,8 +49,8 @@ public class TestA2CNESIterative {
final String datasetName = "FacesUCR";
final String datasetPath = "FacesUCR";
final String dataPath = System.getProperty("user.home") + "/A2CNES/";
final String resultPath = System.getProperty("user.home") + "/A2CNES/results_iter/";
final String dataPath = System.getProperty("user.home")+"/A2CNES/";
final String resultPath = System.getProperty("user.home")+"/A2CNES/results_iter/";
final int nInf = 12;
final int nSup = 17;
final int ag1_seeds = 16;
......@@ -61,7 +58,7 @@ public class TestA2CNESIterative {
final int ag3_seeds = 24;
final int nb_iter = 15;
// String testResultPath = "~/A2CNES/Train_results/";
// String testResultPath = System.getProperty("user.home")+"/A2CNES/Train_results/";
// Data dataTrain = TestA2CNES.getDataFromFile(dataPath+datasetPath+"/train/"+datasetName+".data", '\t', "train", null);
final Data dataTest = TestA2CNES.getDataFromFile(dataPath+datasetPath+"/test/"+datasetName+".data", '\t', "test", null);
......@@ -164,6 +161,7 @@ public class TestA2CNESIterative {
try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(
Paths.get(dataPath+datasetName+"/train/"), "*0.1_*")) {
Iterator<Path> iter = dirStream.iterator();
final String rand = Integer.toString((int) (Math.random()*1000));
while(iter.hasNext()) {
final Vector<Constraint> constraints = new Vector<Constraint>();
String filename = iter.next().getFileName().toString();
......@@ -234,7 +232,7 @@ public class TestA2CNESIterative {
FileWriter fw = null;
try {
fw = new FileWriter("log_cst"+classif.getName()+".log", true);
fw = new FileWriter("log/"+rand+"log_cst"+classif.getName()+".log", true);
} catch (IOException e) {
e.printStackTrace();
}
......@@ -242,7 +240,7 @@ public class TestA2CNESIterative {
PrintWriter out = new PrintWriter(bw);
Distance[] distances = new Distance[1]; // a distance is set for every attribute
distances[0] = jcl.data.distance.sequential.DistanceDTW.getInstance(); // second attribute (sequential) compared with the DTW distance
distances[0] = jcl.data.distance.sequential.DistanceDTWMD.getInstance(); // second attribute (sequential) compared with the DTW distance
MetaDistance metaDistance = MetaDistanceEuclidean.getInstance(); // defines the way the two scores are combined (possibility to weight)
Model model = new Model(distances, metaDistance);
......@@ -268,9 +266,9 @@ public class TestA2CNESIterative {
}
Mask satisfactionMask = new IntArrayMask(satisifiedMap, 1, true);
extractAndAddConstraints(subset, constraints, subsetSize, satisfactionMask);
Vector<Constraint> subset = extractConstraints(constraints, subsetSize, satisfactionMask);
out.println("------- new iter : "+ (i+1) + " --------");
for (Constraint c : constraints) {
for (Constraint c : subset) {
if (c instanceof MustLinkConstraint) {
MustLinkConstraint ml = (MustLinkConstraint) c;
out.println(c.toString()+";"+
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment