Commit bd1cc665 authored by lafabregue's avatar lafabregue

finalisation of merge with master

parent 119b5fee
package mustic.gui.panels;
import java.io.File;
import java.util.Vector;
import javax.swing.JOptionPane;
import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.learning.LearningParameters;
import jcl.learning.methods.monostrategy.ahc.ParametersAHC;
import jcl.learning.methods.monostrategy.cobweb.ParametersCobweb;
import jcl.learning.methods.monostrategy.cure.ParametersCure;
import jcl.learning.methods.monostrategy.em.ParametersEM;
import jcl.learning.methods.monostrategy.gng.ParametersGNG;
import jcl.learning.methods.monostrategy.kmeans.ParametersKmeans;
import jcl.learning.methods.monostrategy.perceptron.ParametersPerceptron;
import jcl.learning.methods.monostrategy.random.ParametersRandom;
import jcl.learning.methods.monostrategy.som.ParametersSOM;
import jcl.weights.*;
import mustic.gui.DesktopFrame;
import mustic.gui.MainFrame;
import mustic.gui.panels.classifier.components.HybridClassificationPanel;
import mustic.io.*;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
public class HybridParametersHandler extends DefaultHandler {
private static final int AHC = 13;
private static final int COBWEB = 1;
private static final int CURE = 12;
private static final int EM = 4;
private static final int FUZZI_C_MEAN = 6;
private static final int FUZZY_GW_C_MEANS = 8;
private static final int FUZZY_LW_C_MEANS = 10;
private static final int GNG = 11;
private static final int GW_K_MEAN = 7;
private static final int K_MEANS = 0;
private static final int LW_K_MEANS = 9;
private static final int PERCEPTRON = 3;
private static final int RANDOM = 5;
private static final int SOM = 2;
private StringBuffer buffer;
private HybridClassificationPanel hybridPanel;
private boolean isHClustering;
private boolean isPanel;
private boolean isSimplifySequence;
private boolean isUseNaiveDist;
// private String data = null;
private Vector<String> listData = new Vector<String>();
private Vector<Double> listParam = new Vector<Double>();
private LearningParameters param = null;
private int type;
private Weights weight;
// simple constructeur
public HybridParametersHandler(HybridClassificationPanel hc, boolean isPanel) {
super();
this.hybridPanel = hc;
this.isPanel = isPanel;
}
// détection de caractères
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
String lecture = new String(ch, start, length);
if (buffer != null)
buffer.append(lecture);
}
// fin du parsing
@Override
public void endDocument() throws SAXException {
System.out.println("Agents ouverts");
}
// détection fin de balise
@Override
public void endElement(String uri, String localName, String qName) throws SAXException {
if (qName.equals("ListAgents")) {}
else if (qName.equals("agent")) {
ClassificationWeights weights = new GlobalWeights(this.weight);
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop().getAllDesktopFrames();
int nbSessions = desktopFrames.length;
ImageData data = null;
for (int i = 0; i < nbSessions; i++) {
if (this.listData.get(0).equals(desktopFrames[i].getImageSession().getRawImage().getPath())) {
data = desktopFrames[i].getImageSession().getImageData();
break;
}
}
if (data == null && this.isPanel) {
File f = new File(this.listData.get(0));
if (!f.exists()) {
JOptionPane.showMessageDialog(this.hybridPanel, this.listData.get(0) + "not found", "Warning", JOptionPane.WARNING_MESSAGE);
MainFrame.getInstance().openNewFile();
MainFrame.getInstance().getCurrentSession().associatedFrame.toBack();
data = MainFrame.getInstance().getCurrentSession().getImageData();
}
else {
try {
System.out.println("\n ouverture de " + f);
MainFrame.getInstance().createSession(MainFrame.getInstance().open(f), null);
if (MainFrame.getInstance().getCurrentSession().getRawImage().getNbBands() > 1) {
MainFrame.getInstance().getCurrentSession().getBirdViewPanel().setR(0);
MainFrame.getInstance().getCurrentSession().getBirdViewPanel().setG(1);
MainFrame.getInstance().getCurrentSession().getBirdViewPanel().setB(2);
MainFrame.getInstance().getCurrentSession().getBirdViewPanel().syncImage(MainFrame.getInstance().getCurrentSession());
PictureTool.setR(MainFrame.getInstance().getCurrentSession().getRawImage().getBirdview(), 0);
PictureTool.setG(MainFrame.getInstance().getCurrentSession().getRawImage().getBirdview(), 1);
PictureTool.setB(MainFrame.getInstance().getCurrentSession().getRawImage().getBirdview(), 2);
MainFrame.getInstance().getCurrentSession().getBirdViewPanel().refresh();
MainFrame.getInstance().getCurrentSession().associatedFrame.toBack();
data = MainFrame.getInstance().getCurrentSession().getImageData();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
else {
File f = new File(this.listData.get(0));
try {
data = new ImageData(MainFrame.getInstance().open(f));
} catch (Exception e) {
e.printStackTrace();
}
}
boolean open = false;
if (this.listData.size() > 1) {
RawImage images[] = new RawImage[this.listData.size()];
for (int im = 0; im < this.listData.size(); im++) {
for (int i = 0; i < nbSessions; i++) {
if (this.listData.get(im).equals(desktopFrames[i].getImageSession().getRawImage().getPath())) {
images[im] = desktopFrames[i].getImageSession().getRawImage();
open = true;
break;
}
if (!open) {
File f = new File(this.listData.get(im));
try {
images[im] = MainFrame.getInstance().open(f);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
ImageMultiDimSequenceData sequenceData = new ImageMultiDimSequenceData(images);
data.setSequence(sequenceData);
Vector<String> filesName = new Vector<String>();
filesName.add("sequence");
data.setDataFilesName(filesName); //$NON-NLS-1$
} else {
Vector<String> filesName = new Vector<String>();
filesName.add(this.listData.get(0));
}
switch (this.type) {
case K_MEANS:
this.param = new ParametersKmeans(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), weights);
break;
case COBWEB:
this.param = new ParametersCobweb(this.listParam.get(0), this.listParam.get(1), this.listParam.get(2).intValue(), this.listParam
.get(3).intValue(), this.listParam.get(4).intValue(), weights);
break;
case SOM:
this.param = new ParametersSOM(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(2)
.intValue(), this.listParam.get(3), weights);
break;
case PERCEPTRON:
this.param = new ParametersPerceptron(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(2),
this.listParam.get(3), weights);
break;
case EM:
this.param = new ParametersEM(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), weights);
break;
case RANDOM:
this.param = new ParametersRandom(this.listParam.get(0).intValue(), weights);
break;
case FUZZI_C_MEAN:
this.param = new ParametersKmeans(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(4),
weights);
break;
case GW_K_MEAN:
this.param = new ParametersKmeans(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(2),
ParametersKmeans.GLOBAL_FEATURE_WEIGHTING, weights);
break;
case FUZZY_GW_C_MEANS:
this.param = new ParametersKmeans(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(4),
this.listParam.get(2), ParametersKmeans.GLOBAL_FEATURE_WEIGHTING, weights);
break;
case LW_K_MEANS:
this.param = new ParametersKmeans(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(2),
ParametersKmeans.LOCAL_FEATURE_WEIGHTING, weights);
break;
case FUZZY_LW_C_MEANS:
this.param = new ParametersKmeans(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(4),
this.listParam.get(2), ParametersKmeans.LOCAL_FEATURE_WEIGHTING, weights);
break;
case GNG:
this.param = new ParametersGNG(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(2)
.intValue(), this.listParam.get(3).intValue(), weights);
break;
case CURE:
this.param = new ParametersCure(this.listParam.get(0).intValue(), this.listParam.get(1).intValue(), this.listParam.get(2),
weights);
break;
case AHC:
this.param = new ParametersAHC(this.listParam.get(0).intValue(), null);
break;
}
this.param.setHClustering(this.isHClustering);
if (this.isSimplifySequence) {
AttributeMultiDimSequence.setSimplifyFrom(0);
}
if (this.isUseNaiveDist) {
AttributeMultiDimSequence.setMode(AttributeMultiDimSequence.EUCLIDIEN);
}
this.hybridPanel.addAgent(this.param, data);
param = null;
this.listData.clear();
if (MainFrame.DEBUG_MODE)
System.out.println("ouvert");
}
else if (qName.equals("typeMethode")) {
if (buffer.toString().equals("K-means"))
this.type = K_MEANS;
else if (buffer.toString().equals("Cobweb"))
this.type = COBWEB;
else if (buffer.toString().equals("S.O.M."))
this.type = SOM;
else if (buffer.toString().equals("Perceptron"))
this.type = PERCEPTRON;
else if (buffer.toString().equals("EM"))
this.type = EM;
else if (buffer.toString().equals("Random"))
this.type = RANDOM;
else if (buffer.toString().equals("Fuzzy-C-means"))
this.type = FUZZI_C_MEAN;
else if (buffer.toString().equals("GAW-K-means"))
this.type = GW_K_MEAN;
else if (buffer.toString().equals("GAW-Fuzzy-C-means"))
this.type = FUZZY_GW_C_MEANS;
else if (buffer.toString().equals("LAW-K-means"))
this.type = LW_K_MEANS;
else if (buffer.toString().equals("LAW-Fuzzy-C-means"))
this.type = FUZZY_LW_C_MEANS;
else if (buffer.toString().equals("Growing Neural Gas"))
this.type = GNG;
else if (buffer.toString().equals("CURE"))
this.type = CURE;
else if (buffer.toString().equals("AHC"))
this.type = AHC;
this.listParam.removeAllElements();
buffer = null;
}
else if (qName.equals("param")) {
buffer = null;
}
else if (qName.equals("value")) {
this.listParam.add(Double.parseDouble(buffer.toString()));
buffer = null;
}
else if (qName.equals("isSimplifySequence")) {
this.isSimplifySequence = buffer.toString().equals("true");
buffer = null;
}
else if (qName.equals("isUseNaiveDist")) {
this.isUseNaiveDist = buffer.toString().equals("true");
buffer = null;
}
else if (qName.equals("data")) {
listData.add(buffer.toString());
buffer = null;
}
else if (qName.equals("weight")) {
String[] poids = buffer.toString().split(",");
double[] w = new double[poids.length];
for (int i = 0; i < poids.length; i++) {
w[i] = Double.parseDouble(poids[i]);
}
this.weight = new Weights(w);
buffer = null;
}
else {
throw new SAXException("Balise " + qName + " inconnue.");
}
}
// début du parsing
@Override
public void startDocument() throws SAXException {
System.out.println("Ouverture des agents");
}
// détection d'ouverture de balise
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
if (qName.equals("ListAgents")) {}
else if (qName.equals("agent")) {
try {
int id = Integer.parseInt(attributes.getValue("id"));
System.out.print("agent " + id + " : ");
} catch (Exception e) {
throw new SAXException(e);
}
}
else {
buffer = new StringBuffer();
if (qName.equals("typeMethode")) {}
else if (qName.equals("param")) {}
else if (qName.equals("value")) {}
else if (qName.equals("isSimplifySequence")) {}
else if (qName.equals("isUseNaiveDist")) {}
else if (qName.equals("data")) {}
else if (qName.equals("weight")) {}
else {
throw new SAXException("Balise " + qName + " inconnue.");
}
}
}
}
...@@ -20,6 +20,7 @@ import jcl.learning.methods.monostrategy.som.ParametersSOM; ...@@ -20,6 +20,7 @@ import jcl.learning.methods.monostrategy.som.ParametersSOM;
import jcl.weights.ClassificationWeights; import jcl.weights.ClassificationWeights;
import jcl.weights.GlobalWeights; import jcl.weights.GlobalWeights;
import jcl.weights.Weights; import jcl.weights.Weights;
import mustic.gui.DataDesktopFrame;
import mustic.gui.DesktopFrame; import mustic.gui.DesktopFrame;
import mustic.gui.ImageDesktopFrame; import mustic.gui.ImageDesktopFrame;
import mustic.gui.MainFrame; import mustic.gui.MainFrame;
...@@ -861,52 +862,52 @@ public class ClassifierHandler extends DefaultHandler { ...@@ -861,52 +862,52 @@ public class ClassifierHandler extends DefaultHandler {
} else if (qName.equals("InitMethod")) { //$NON-NLS-1$ } else if (qName.equals("InitMethod")) { //$NON-NLS-1$
Data data = null; Data data = null;
DesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop() DataDesktopFrame[] desktopFrames = MainFrame.getInstance().getDesktop()
.getAllDesktopFrames(); .getAllDataDesktopFrames();
int nbSessions = desktopFrames.length; int nbSessions = desktopFrames.length;
for (int i = 0; i < nbSessions; i++) { for (int i = 0; i < nbSessions; i++) {
if (this.listData.get(0).equals( if (this.listData.get(0).equals(
desktopFrames[i].getImageSession().getRawImage() desktopFrames[i].getDataSession().getAssociatedImageSessions().get(0)
.getPath())) { .getRawImage().getPath())) {
data = desktopFrames[i].getImageSession().getImageData(); data = desktopFrames[i].getDataSession().getData();
break; break;
} }
} }
if (data == null) { if (data == null) {
File f = new File(this.listData.get(0)); File f = new File(this.listData.get(0));
try { try {
MainFrame.getInstance().createSession( MainFrame.getInstance().createImageSession(
MainFrame.getInstance().open(f), null); MainFrame.getInstance().open(f), null);
if (MainFrame.getInstance().getCurrentSession() if (MainFrame.getInstance().getCurrentImageSession()
.getRawImage().getNbBands() > 1) { .getRawImage().getNbBands() > 1) {
MainFrame.getInstance().getCurrentSession() MainFrame.getInstance().getCurrentImageSession()
.getBirdViewPanel().setR(0); .getBirdViewPanel().setR(0);
MainFrame.getInstance().getCurrentSession() MainFrame.getInstance().getCurrentImageSession()
.getBirdViewPanel().setG(1); .getBirdViewPanel().setG(1);
MainFrame.getInstance().getCurrentSession() MainFrame.getInstance().getCurrentImageSession()
.getBirdViewPanel().setB(2); .getBirdViewPanel().setB(2);
MainFrame MainFrame
.getInstance() .getInstance()
.getCurrentSession() .getCurrentImageSession()
.getBirdViewPanel() .getBirdViewPanel()
.syncImage( .syncImage(
MainFrame.getInstance() MainFrame.getInstance()
.getCurrentSession()); .getCurrentImageSession());
PictureTool.setR(MainFrame.getInstance() PictureTool.setR(MainFrame.getInstance()
.getCurrentSession().getRawImage() .getCurrentImageSession().getRawImage()
.getBirdview(), 0); .getBirdview(), 0);
PictureTool.setG(MainFrame.getInstance() PictureTool.setG(MainFrame.getInstance()
.getCurrentSession().getRawImage() .getCurrentImageSession().getRawImage()
.getBirdview(), 1); .getBirdview(), 1);
PictureTool.setB(MainFrame.getInstance() PictureTool.setB(MainFrame.getInstance()
.getCurrentSession().getRawImage() .getCurrentImageSession().getRawImage()
.getBirdview(), 2); .getBirdview(), 2);
MainFrame.getInstance().getCurrentSession() MainFrame.getInstance().getCurrentImageSession()
.getBirdViewPanel().refresh(); .getBirdViewPanel().refresh();
MainFrame.getInstance().getCurrentSession().associatedFrame MainFrame.getInstance().getCurrentImageSession().associatedFrame
.toBack(); .toBack();
data = MainFrame.getInstance().getCurrentSession() data = MainFrame.getInstance().getCurrentImageSession()
.getData(); .getData();
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -18,17 +18,9 @@ import jcl.Classification; ...@@ -18,17 +18,9 @@ import jcl.Classification;
import jcl.data.Data; import jcl.data.Data;
import jcl.data.DataObject; import jcl.data.DataObject;
import jcl.data.attribute.AttributeMultiDimSequence; import jcl.data.attribute.AttributeMultiDimSequence;
import jcl.data.attribute.AttributeSequence;
import jcl.data.distance.Distance;
import jcl.data.distance.DistanceModel; import jcl.data.distance.DistanceModel;
import jcl.data.distance.DistanceParameter; import jcl.data.distance.DistanceParameter;
import jcl.data.distance.EmptyDistanceParameter;
import jcl.data.distance.average.AverageParameter; import jcl.data.distance.average.AverageParameter;
import jcl.data.distance.average.EmptyAverageParameter;
import jcl.data.distance.average.ParameterDBAMean;
import jcl.data.distance.sequential.DistanceDTW;
import jcl.data.distance.sequential.DistanceDTWMD;
import jcl.data.distance.sequential.ParameterDTW;
import jcl.io.arff.ClassificationParametersIO; import jcl.io.arff.ClassificationParametersIO;
import jcl.jcld.RmiServer; import jcl.jcld.RmiServer;
import jcl.learning.LearningParameters; import jcl.learning.LearningParameters;
...@@ -955,25 +947,9 @@ public class ClassifierPanel extends JPanel { ...@@ -955,25 +947,9 @@ public class ClassifierPanel extends JPanel {
} }
/* generates distance parameters */ /* generates distance parameters */
// DistanceParameter[][] distanceParameters = new DistanceParameter[1][model.getDistances().length];
// int i = 0;
// for (Distance d : model.getDistances()) {
// if(d instanceof DistanceDTWMD) {
// AttributeMultiDimSequence seq = (AttributeMultiDimSequence) data.getOneDataObject().getAttribute(i);//need the corresponding attribute to get the sequence length
// distanceParameters[0][i] = new ParameterDTW(new double[seq.getNbTuples()][seq.getNbTuples()]); //special attribute for DTW distances (requires a matrix to work in)
// }
// else if(d instanceof DistanceDTW) {
// AttributeSequence seq = (AttributeSequence) data.getOneDataObject().getAttribute(i);//need the corresponding attribute to get the sequence length
// distanceParameters[0][i] = new ParameterDTW(new double[seq.getNbTuples()][seq.getNbTuples()]); //special attribute for DTW distances (requires a matrix to work in)
// }
// else {
// distanceParameters[0][i] = EmptyDistanceParameter.getInstance();//no parameter for a numerical euclidean distance
// }
// i++;
// }
int nbThreads = Runtime.getRuntime().availableProcessors(); int nbThreads = Runtime.getRuntime().availableProcessors();
DistanceParameter[][] distanceParameters = DistanceModel.generateDefaultDistanceParameters(nbThreads, model, data); DistanceParameter[][] distanceParameters = DistanceModel.generateDefaultDistanceParameters(nbThreads, model, data);
AverageParameter[] averageParameters = DistanceModel.generateDefaultAverageParameters(model, data);
int choice = this.modele.getSelectedApproach(); int choice = this.modele.getSelectedApproach();
...@@ -996,7 +972,8 @@ public class ClassifierPanel extends JPanel { ...@@ -996,7 +972,8 @@ public class ClassifierPanel extends JPanel {
System.out.println(nbClassifications + " " + nbClustersMin + " " //$NON-NLS-1$ //$NON-NLS-2$ System.out.println(nbClassifications + " " + nbClustersMin + " " //$NON-NLS-1$ //$NON-NLS-2$
+ nbClustersMax); + nbClustersMax);
params = new ParametersEvidence(nbClassifications, nbClustersMax, nbClustersMin, pourcentage, model, distanceParameters); params = new ParametersEvidence(nbClassifications, nbClustersMax, nbClustersMin, pourcentage,
model, distanceParameters, averageParameters);
return params; return params;
} }
...@@ -1022,7 +999,6 @@ public class ClassifierPanel extends JPanel { ...@@ -1022,7 +999,6 @@ public class ClassifierPanel extends JPanel {
if (filePath.endsWith(".arff")) { //$NON-NLS-1$ if (filePath.endsWith(".arff")) { //$NON-NLS-1$
int[][] clustering = DataArffExchange.arffToClusteredIndexes(filePath); int[][] clustering = DataArffExchange.arffToClusteredIndexes(filePath);
List<DataObject> result = ClassifierKmeans.getCentroidsFromClustering(data, clustering, model, null );//TODO List<DataObject> result = ClassifierKmeans.getCentroidsFromClustering(data, clustering, model, null );//TODO
AverageParameter[] averageParameters = DistanceModel.generateDefaultAverageParameters(model, data);
params = new ParametersKmeans(result.size(), 0, model, distanceParameters, averageParameters); params = new ParametersKmeans(result.size(), 0, model, distanceParameters, averageParameters);
params.setSamples(new Vector<DataObject>(result)); params.setSamples(new Vector<DataObject>(result));
} else { } else {
...@@ -1066,7 +1042,6 @@ public class ClassifierPanel extends JPanel { ...@@ -1066,7 +1042,6 @@ public class ClassifierPanel extends JPanel {
// } // }
// distanceParametersK[th] = distanceParameters; // distanceParametersK[th] = distanceParameters;
// } // }
AverageParameter[] averageParameters = DistanceModel.generateDefaultAverageParameters(model, data);
params = new ParametersKmeans(nbClusters, nbIters, nbThreads, model, distanceParameters, averageParameters); params = new ParametersKmeans(nbClusters, nbIters, nbThreads, model, distanceParameters, averageParameters);
params.setModel(model); params.setModel(model);
break; break;
...@@ -1075,7 +1050,6 @@ public class ClassifierPanel extends JPanel { ...@@ -1075,7 +1050,6 @@ public class ClassifierPanel extends JPanel {
int nbClusters = Integer.valueOf(((JTextField) comp[1]).getText()).intValue(); int nbClusters = Integer.valueOf(((JTextField) comp[1]).getText()).intValue();
int nbIters = Integer.valueOf(((JTextField) comp[3]).getText()).intValue(); int nbIters = Integer.valueOf(((JTextField) comp[3]).getText()).intValue();
double m = Double.valueOf(((JTextField) comp[5]).getText()).doubleValue(); double m = Double.valueOf(((JTextField) comp[5]).getText()).doubleValue();
AverageParameter[] averageParameters = DistanceModel.generateDefaultAverageParameters(model, data);
params = new ParametersKmeans(nbClusters, nbIters, m, model, distanceParameters, averageParameters); params = new ParametersKmeans(nbClusters, nbIters, m, model, distanceParameters, averageParameters);
break; break;
} }
...@@ -1085,7 +1059,7 @@ public class ClassifierPanel extends JPanel { ...@@ -1085,7 +1059,7 @@ public class ClassifierPanel extends JPanel {
int maxDepth = Integer.valueOf(((JTextField) comp[5]).getText()).intValue(); int maxDepth = Integer.valueOf(((JTextField) comp[5]).getText()).intValue();
int nombre_passes = Integer.valueOf(((JTextField) comp[7]).getText()).intValue(); int nombre_passes = Integer.valueOf(((JTextField) comp[7]).getText()).intValue();
int minCard = Integer.valueOf(((JTextField) comp[9]).getText()).intValue(); int minCard = Integer.valueOf(((JTextField) comp[9]).getText()).intValue();
params = new ParametersCobweb(acuteness, mapi, maxDepth, nombre_passes, minCard, model, distanceParameters); params = new ParametersCobweb(acuteness, mapi, maxDepth, nombre_passes, minCard);
break; break;
} }
case ClassifierUtils.SOM: { case ClassifierUtils.SOM: {
...@@ -1093,7 +1067,7 @@ public class ClassifierPanel extends JPanel { ...@@ -1093,7 +1067,7 @@ public class ClassifierPanel extends JPanel {
int heigth = Integer.valueOf(((JTextField) comp[3]).getText()).intValue(); int heigth = Integer.valueOf(((JTextField) comp[3]).getText()).intValue();
int nbIters = Integer.valueOf(((JTextField) comp[5]).getText()).intValue(); int nbIters = Integer.valueOf(((JTextField) comp[5]).getText()).intValue();
double epsilon = Double.valueOf(((JTextField) comp[7]).getText()).doubleValue(); double epsilon = Double.valueOf(((JTextField) comp[7]).getText()).doubleValue();
params = new ParametersSOM(width, heigth, nbIters, epsilon, weights); params = new ParametersSOM(width, heigth, nbIters, epsilon, model, distanceParameters);
break; break;
} }
case ClassifierUtils.PERCEPTRON: { case ClassifierUtils.PERCEPTRON: {
...@@ -1105,19 +1079,18 @@ public class ClassifierPanel extends JPanel { ...@@ -1105,19 +1079,18 @@ public class ClassifierPanel extends JPanel {
case ClassifierUtils.EM: { case ClassifierUtils.EM: {
int nbClusters = Integer.valueOf(((JTextField) comp[1]).getText()).intValue(); int nbClusters = Integer.valueOf(((JTextField) comp[1]).getText()).intValue();