Commit 7482508b authored by balanche's avatar balanche

work in progess : cleaning of the old distance implementation

parent 965162f4
This diff is collapsed.
......@@ -1199,12 +1199,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
out.closeEntry();
}
out.putNextEntry(new ZipEntry(name + '/' + "ParameterMode.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getMode());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
......@@ -1311,12 +1305,6 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
out.closeEntry();
}
out.putNextEntry(new ZipEntry(name + '/' + "ParameterMode.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getMode());
oos.flush();
out.closeEntry();
out.putNextEntry(new ZipEntry(name + '/' + "ParameterSimplify.ser"));
oos = new ObjectOutputStream(out);
oos.writeObject(AttributeMultiDimSequence.getSimplifyFrom());
......
......@@ -941,20 +941,22 @@ public class ClassifierPanel extends JPanel {
ClassificationWeights weights = new GlobalWeights(data);
if (this.attributeSelectionPanel != null)
weights = this.attributeSelectionPanel.getWeights();
DistanceModel model = null;
/* generates model */
if (this.useNaiveDist) {
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN);
model = DistanceModel.generateNaiveModel(data.getOneDataObject());
model = DistanceModel.generateNaiveModel(data.getOneDataObject(), weights);
}
else {
// AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.DTW_BARYCENTRE);
model = DistanceModel.generateDefaultModel(data.getOneDataObject());
model = DistanceModel.generateDefaultModel(data.getOneDataObject(), weights);
}
if (this.attributeSelectionPanel != null)
weights = this.attributeSelectionPanel.getWeights();
int choice = this.modele.getSelectedApproach();
......@@ -1042,7 +1044,6 @@ public class ClassifierPanel extends JPanel {
else {
distanceParameters[th][i] = EmptyDistanceParameter.getInstance();//no parameter for a numerical euclidean distance
averageParameters[i] = EmptyAverageParameter.getInstance();
}
i++;
}
......
......@@ -10,7 +10,11 @@ import javax.swing.*;
import javax.swing.border.TitledBorder;
import jcl.data.Data;
import jcl.data.attribute.Attribute;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.distance.Distance;
import jcl.data.distance.DistanceParameter;
import jcl.data.distance.sequential.DistanceEuclidean;
import jcl.learning.LearningParameters;
import jcl.learning.methods.multistrategy.samarah.*;
import mustic.gui.MainFrame;
......@@ -151,7 +155,11 @@ public class HybridClassificationPanel extends JPanel implements AgentListManage
else {
file += "\t\t<isSimplifySequence>true</isSimplifySequence>\n";
}
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN) {
for (Distance<Attribute, DistanceParameter> d : agent.getParams().getModel().getDistances()) {
if(!(d instanceof DistanceEuclidean))
}
if (AttributeMultiDimSequence.getMode() == AttributeMultiDimSequence.EUCLIDIEN && agent.getParams().getModel()) {
file += "\t\t<isUseNaiveDist>true</isUseNaiveDist>\n";
}
else {
......
......@@ -533,12 +533,6 @@ public class ImageData extends SimpleData implements Serializable {
public void setResolution(double resolution) {
this.resolution = resolution;
}
private void setProperties(int mode, int simplifyFrom) {
AttributeMultiDimSequence.setMode(mode);
AttributeMultiDimSequence.setSimplifyFrom(simplifyFrom);
}
/**
* <p>
......
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