Commit d9add86f authored by lafabregue's avatar lafabregue

proper implmentation of Model exportation

parent b761d14b
File added
......@@ -19,6 +19,7 @@ import jcl.jcld.RmiServer;
import jcl.jcld.database.SSHParameters;
import jcl.learning.LearningMethod;
import jcl.learning.methods.ClassifierUtils;
import jcl.utils.exceptions.JCLFormatException;
import jcl.utils.exceptions.MethodNotImplementedException;
/**
......@@ -58,7 +59,14 @@ public abstract class Classification extends Observable implements
//pour la classif multires de mustic
private boolean intermediaire = false;
private Data histogrammesDecomp=null;
/** Le resultat de la classification */
protected ClusteringResult clusteringResult = null;
/** Le nom de la classification */
private String name = "";
/**
......@@ -91,12 +99,6 @@ public abstract class Classification extends Observable implements
System.out.println();
}
/** Le resultat de la classification */
protected ClusteringResult clusteringResult = null;
/** Le nom de la classification */
private String name = "";
/**
* <p>
* Constructeur avec un nom.
......@@ -743,4 +745,27 @@ public abstract class Classification extends Observable implements
return this.timeExec;
}
/**
* Export the learned result to a file.
* The model is normally under arff format, the header, written with comments,
* may contain information about contained objects.
* Note that the line "% >>>" should never appear as it is in the export.
*
* @return the String containing the model of the LearningResult
*/
public abstract String ExportResult() throws MethodNotImplementedException, JCLFormatException;
/**
* Import the learned result to a file.
* The model is normally under arff format, the header, written with comments,
* may contain information about contained objects
*
* @param model
* the String containing the model of the LearningResult
* @param classifIndex
* the index of the model type to use
* @return the Classification generated
*/
public abstract Classification ImportResult(String model, int classifIndex) throws MethodNotImplementedException, JCLFormatException;
}
......@@ -17,6 +17,9 @@ import jcl.weights.Weights;
abstract public class Cluster implements Serializable {
/** */
private static final long serialVersionUID = 1L;
/** Le resultat de la classification qui contient ce cluster */
protected final ClusteringResult result;
/** The cluster's gravity center */
protected DataObject clusterCenter = null;
......@@ -44,10 +47,13 @@ abstract public class Cluster implements Serializable {
protected Weights weights = null;
/**
* Empty constructor
* Basic cluster constructor
*
* @param result
* the parent result of the cluster
*/
public Cluster() {
public Cluster(ClusteringResult result) {
this.result = result;
}
/**
......@@ -57,6 +63,7 @@ abstract public class Cluster implements Serializable {
* the cluster to copy
*/
public Cluster(Cluster cluster) {
this(cluster.result);
this.locked = cluster.locked;
this.name = new String(cluster.name);
this.color = new Color(cluster.getColor().getRGB());
......@@ -217,6 +224,17 @@ abstract public class Cluster implements Serializable {
return this.weights;
}
/**
* <p>
* The ClusteringResult that contains this cluster
* <p>
*
* @return the ClusteringResult
*/
public ClusteringResult getResult() {
return result;
}
/**
* <p>
* Test si la classe est lockee.
......
......@@ -110,7 +110,7 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
racine.add(node);
} else {
if (!c.isRoot()) {
final Cluster clus = new SimpleCluster("Noeud " + this.numero);
final Cluster clus = new SimpleCluster("Noeud " + this.numero, this);
this.numero++;
clus.setColor(new Color(r.nextInt(255), r.nextInt(255), r.nextInt(255)));
node = new DefaultMutableTreeNode(clus);
......@@ -144,7 +144,7 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
// test si le noeud (type Agglomerate) est feuille
if (!p.isLeaf()) {
tmpCluster = new SimpleCluster("Agglomerat " + p.numero);
tmpCluster = new SimpleCluster("Agglomerat " + p.numero, this);
res = new DefaultMutableTreeNode(tmpCluster);
tmpCluster.setColor(new Color(r.nextInt(255), r.nextInt(255), r .nextInt(255)));
......@@ -183,7 +183,7 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
// test si le noeud (type Agglomerate) est feuille
if (agglo.getSubAgglomerate1() != null
&& agglo.getSubAgglomerate2() != null) {
tmpCluster = new SimpleCluster("Agglomerat " + this.numero);
tmpCluster = new SimpleCluster("Agglomerat " + this.numero, this);
this.numero++;
......@@ -426,6 +426,21 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
}
return colors;
}
/**
* <p>
* Couleurs des classes.
* </p>
*
* @return les couleurs desclasses
*/
public List<Color> getClustersColorsList() {
final List<Color> colors= new ArrayList<Color>();
for (int i = 0; i < this.clusters.length ; i++) {
colors.add(this.clusters[i].getColor());
}
return colors;
}
/**
* Le resultat du clustering sous forme de tableau, a chaque objet est
......@@ -756,7 +771,7 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
// TODO: corriger la façon d'accéder aux données de cluster (nouveau
// cluster)
DefaultMutableTreeNode node;
final Cluster rac = new SimpleCluster("Racine");
final Cluster rac = new SimpleCluster("Racine", this);
rac.setColor(new Color(255, 255, 255, 0));
rac.setVisible(true);
// rac.setData(this.data);
......@@ -882,7 +897,7 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* @param colors
* les nouvelles couleurs
*/
public void setColors(final ArrayList<Color> colors) {
public void setColors(final List<Color> colors) {
for (int i = 0; i < colors.size(); i++) {
this.clusters[i].setColor(colors.get(i));
}
......@@ -975,14 +990,16 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* Les critere d'evaluation de la classification
* @param learningClusterMap
* Carte de classification issu de l'apprentissage
* @param colors
* a set of colors associated to the clusters, null if auto generated
*
*/
static public ClusteringResult gerenerateDefaultClusteringResult(final LearningResult learning,
final int clusterMap[], final double membershipDegree[][],
ClassificationWeights weights, final int nbClusters,
double proba[], final Data data, final int qualityCriteria[]) {
double proba[], final Data data, final int qualityCriteria[], List<Color> colors) {
return new SimpleClusteringResult(learning,clusterMap, membershipDegree,
weights,nbClusters, proba, data, qualityCriteria);
weights,nbClusters, proba, data, qualityCriteria, colors);
}
/**
......@@ -1006,13 +1023,15 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* les criteres de qualite a calculer
* @param membershipDegree
* les probabilites d'appartenance des classes
* @param colors
* a set of colors associated to the clusters, null if auto generated
*/
static public ClusteringResult gerenerateDefaultClusteringResult(final LearningResult learning,
final int clusterMap[], final double membershipDegree[][],
final ClassificationWeights weights, final int nbClusters,
final Data data, final int qualityCriteria[]) {
final Data data, final int qualityCriteria[], List<Color> colors) {
return gerenerateDefaultClusteringResult(learning, clusterMap, membershipDegree, weights, nbClusters, null,
data, qualityCriteria);
data, qualityCriteria, colors);
}
/**
......@@ -1034,13 +1053,15 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* les donnees
* @param qualityCriteria
* les criteres de qualite a calculer
* @param colors
* a set of colors associated to the clusters, null if auto generated
*
*/
static public ClusteringResult gerenerateDefaultClusteringResult(final LearningResult learning,
final int clusterMap[], final ClassificationWeights weights,
final int nbClusters, final Data data, final int qualityCriteria[]) {
final int nbClusters, final Data data, final int qualityCriteria[], List<Color> colors) {
return gerenerateDefaultClusteringResult(learning, clusterMap, null, weights, nbClusters, null, data,
qualityCriteria);
qualityCriteria, colors);
}
/**
......@@ -1064,13 +1085,15 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* les criteres de qualite a calculer
* @param associed
* ???
* @param colors
* a set of colors associated to the clusters, null if auto generated
*/
static public ClusteringResult gerenerateDefaultClusteringResult(final LearningResult learning,
final int clusterMap[], final ClassificationWeights weights,
final int nbClusters, final Data data, final int associed[],
final int qualityCriteria[]) {
final int qualityCriteria[], List<Color> colors) {
ClusteringResult result = gerenerateDefaultClusteringResult(learning, clusterMap, null, weights, nbClusters, null, data,
qualityCriteria);
qualityCriteria, colors);
result.associatedTo = new int[associed.length];
for (int i = 0; i < associed.length; i++) {
result.associatedTo[i] = associed[i];
......@@ -1085,20 +1108,8 @@ public abstract class ClusteringResult implements Serializable, MemoryFlush {
* Implementation par defaut actuelle : SimpleCluster
* </p>
*
* @param learning
* le resultat d'apprentissage
* @param clusterMap
* le tableau d'affectation des objets aux classes
* @param weights
* les ponderations des attributs
* @param nbClusters
* le nombre de classes
* @param data
* les donnees
* @param qualityCriteria
* les criteres de qualite a calculer
* @param associed
* ???
* @param clusters
* the set of clusters
*/
static public ClusteringResult gerenerateDefaultClusteringResult(Cluster[] clusters) {
ClusteringResult result = new SimpleClusteringResult(clusters);
......
......@@ -12,9 +12,6 @@ public class LightCluster extends Cluster {
/** */
private static final long serialVersionUID = 1L;
/** Le resultat de la classification qui contient ce cluster */
private final ClusteringResult result;
/** L'index qui correspond a la place du cluster dans result */
private int id = -1;
......@@ -45,7 +42,7 @@ public class LightCluster extends Cluster {
* the cluster cardinality
*/
public LightCluster(final ClusteringResult result, int id, DataObject center, int card) {
this.result = result;
super(result);
this.id = id;
this.clusterCenter = center;
this.cardinal = card;
......@@ -67,7 +64,7 @@ public class LightCluster extends Cluster {
* the cluster centroid
*/
public LightCluster(final ClusteringResult result, int id, DataObject center) {
this.result = result;
super(result);
this.id = id;
this.clusterCenter = center;
this.cardinal = IntArrayMask.objectInMask(result.getClusterMap(), id);
......@@ -87,7 +84,7 @@ public class LightCluster extends Cluster {
* the id of the cluster in the CLusteringResult
*/
public LightCluster(final ClusteringResult result, int id) {
this.result = result;
super(result);
this.id = id;
this.cardinal = IntArrayMask.objectInMask(result.getClusterMap(), id);
this.weights = new Weights(result.getData().getOneDataObject().getNbAttributes());
......@@ -104,7 +101,6 @@ public class LightCluster extends Cluster {
public LightCluster(LightCluster cluster) {
super(cluster);
this.result = cluster.getResult();
this.id = cluster.getId();
this.clusterCenter = cluster.getCenter();
this.cardinal = cluster.cardinal;
......@@ -205,17 +201,6 @@ public class LightCluster extends Cluster {
this.id = id;
}
/**
* <p>
* The ClusteringResult that contains this cluster
* <p>
*
* @return the ClusteringResult
*/
public ClusteringResult getResult() {
return result;
}
@Override
public DataObject getCenter() {
return clusterCenter;
......
......@@ -22,15 +22,8 @@ public class SimpleCluster extends Cluster {
/** Les donnees appartenant aéé& ce cluster */
private Data data = null;
/** The whole data of the classification */
private Data wholeData = null;
/** Le degre d'appartenance de chaque objet a ce cluster */
private double membershipDegree[] = null;
/** Le degre d'appartenance de chaque objet a ce cluster */
private double wholeDatamembershipDegree[] = null;
/** Probabilite de la classe (pour EM) */
private double membershipProbabilityEM = 0;
......@@ -73,10 +66,13 @@ public class SimpleCluster extends Cluster {
* le degre d'appartenance de tous les objets a la classe
* @param proba
* probabilite qu'un objet appartienne a cette classe
* @param result
* the parent result of the cluster
*/
public SimpleCluster(final Data data, final int clusterMap[], final int k,
final Weights weights, final double membershipDegree[],
final double proba) {
final double proba, ClusteringResult result) {
super(result);
int c = 0;
this.weights = weights;
this.membershipDegree = new double[clusterMap.length];
......@@ -98,7 +94,6 @@ public class SimpleCluster extends Cluster {
}
}
this.wholeData = data;
// TODO this.data = new Data(c, data.getStructure());
this.data = new SimpleData(c);
this.data.setComments(data.getComments());
......@@ -149,10 +144,14 @@ public class SimpleCluster extends Cluster {
* le degre d'appartenance de tous les objets a la classe
* @param proba
* probabilite qu'un objet appartienne a cette classe
* @param result
* the parent result of the cluster
*/
public SimpleCluster(final DataObject center, final Data data,
final int clusterMap[], final int k, final Weights weights,
final double membershipDegree[], final double proba) {
final double membershipDegree[], final double proba,
ClusteringResult result) {
super(result);
int c = 0;
this.weights = weights;
this.membershipDegree = new double[clusterMap.length];
......@@ -214,8 +213,11 @@ public class SimpleCluster extends Cluster {
*
* @param name
* le nom du cluster
* @param result
* the parent result of the cluster
*/
public SimpleCluster(final String name) {
public SimpleCluster(final String name, ClusteringResult result) {
super(result);
this.name = name;
}
......
package jcl.clustering;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
......@@ -103,13 +104,16 @@ public class SimpleClusteringResult extends ClusteringResult {
* probabilite de chaque classe
* @param qualityCriteria
* Les critere d'evaluation de la classification
* @param colors
* a set of colors associated to the clusters, null if auto generated
*
*/
@SuppressWarnings("unchecked")
public SimpleClusteringResult(final LearningResult learning,
final int clusterMap[], final double membershipDegree[][],
ClassificationWeights weights, final int nbClusters,
double proba[], final Data data, final int qualityCriteria[]) {
double proba[], final Data data, final int qualityCriteria[],
List<Color> colors) {
this.data = data;
this.learningResult = learning;
if (weights == null) {
......@@ -193,7 +197,11 @@ public class SimpleClusteringResult extends ClusteringResult {
}
this.weights = (ClassificationWeights) weights.clone();
ClustersColorizer.colorizeRandom(this);
if (colors == null) {
ClustersColorizer.colorizeRandom(this);
} else {
setColors(colors);
}
}
/**
......
......@@ -215,7 +215,7 @@ public abstract class Data implements Cloneable, Serializable, Iterable<DataObje
public void setKnownResult(final int[] clusterMap, final int nbClusters) {
this.setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap,
null, new GlobalWeights(this), nbClusters, null, this, new int[0]));
null, new GlobalWeights(this), nbClusters, null, this, new int[0], null));
}
/**
......@@ -353,7 +353,7 @@ public abstract class Data implements Cloneable, Serializable, Iterable<DataObje
public Data(final List<DataObject> data, final int[] knownResult, final int nbClusters) {
this.currentView = data;
this.knownResult = ClusteringResult.gerenerateDefaultClusteringResult(null, knownResult,
new GlobalWeights(this), nbClusters, this, null);
new GlobalWeights(this), nbClusters, this, null, null);
}
/**
......@@ -365,7 +365,7 @@ public abstract class Data implements Cloneable, Serializable, Iterable<DataObje
public Data(final List<DataObject> data, final int[] knownResult, final int nbClusters,Model model) {
this.currentView = data;
this.knownResult = ClusteringResult.gerenerateDefaultClusteringResult(null, knownResult,
new GlobalWeights(this), nbClusters, this, null);
new GlobalWeights(this), nbClusters, this, null, null);
this.model = model;
}
......@@ -1049,7 +1049,7 @@ public abstract class Data implements Cloneable, Serializable, Iterable<DataObje
subset = this.newData(objects);
final ClusteringResult result = ClusteringResult.gerenerateDefaultClusteringResult(null, groundTruth,
new GlobalWeights(this), this.getKnownResult().getNbClusters(), subset, new int[0]);
new GlobalWeights(this), this.getKnownResult().getNbClusters(), subset, new int[0], null);
subset.setKnownResult(result);
} else {
for (int i = 0; i < selectedObjects.length; i++) {
......@@ -1229,7 +1229,7 @@ public abstract class Data implements Cloneable, Serializable, Iterable<DataObje
this.currentView.remove(index);
if (this.knownResult != null) {
this.knownResult = ClusteringResult.gerenerateDefaultClusteringResult(null, newGroundTruth,
new GlobalWeights(this), this.knownResult.getNbClusters(), this, null);
new GlobalWeights(this), this.knownResult.getNbClusters(), this, null, null);
}
}
......
......@@ -210,7 +210,7 @@ public class SimpleData extends Data {
}
this.setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap,
new GlobalWeights(this), data[0].getKnownResult().getNbClusters(), this, new int[0]));
new GlobalWeights(this), data[0].getKnownResult().getNbClusters(), this, new int[0], null));
} else {
this.knownResult = null;
}
......@@ -276,7 +276,7 @@ public class SimpleData extends Data {
}
if (data.getKnownResult() != null) {
this.setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap,
new GlobalWeights(this), data.getKnownResult().getNbClusters(), this, new int[0]));
new GlobalWeights(this), data.getKnownResult().getNbClusters(), this, new int[0], null));
}
this.estimatedMinDistance = data.getEstimatedMinDistance();
......@@ -376,7 +376,7 @@ public class SimpleData extends Data {
public SimpleData(final List<DataObject> data, final int[] knownResult, final int nbClusters) {
this.currentView = data;
this.knownResult = ClusteringResult.gerenerateDefaultClusteringResult(null, knownResult,
new GlobalWeights(this), nbClusters, this, null);
new GlobalWeights(this), nbClusters, this, null, null);
this.wholeDataNbObjects = data.size();
}
......@@ -389,7 +389,7 @@ public class SimpleData extends Data {
public SimpleData(final List<DataObject> data, final int[] knownResult, final int nbClusters,Model model) {
this.currentView = data;
this.knownResult = ClusteringResult.gerenerateDefaultClusteringResult(null, knownResult,
new GlobalWeights(this), nbClusters, this, null);
new GlobalWeights(this), nbClusters, this, null, null);
this.model = model;
this.wholeDataNbObjects = data.size();
}
......@@ -536,7 +536,7 @@ public class SimpleData extends Data {
}
if (this.getKnownResult() != null) {
data[j].setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap[j],
new GlobalWeights(data[j]), this.getKnownResult().getNbClusters(), data[j], new int[0]));
new GlobalWeights(data[j]), this.getKnownResult().getNbClusters(), data[j], new int[0], null));
}
data[j].calcStats();
}
......@@ -558,7 +558,7 @@ public class SimpleData extends Data {
objects.remove(index);
final Data loo = new SimpleData(objects,model);
final ClusteringResult result = ClusteringResult.gerenerateDefaultClusteringResult(null,
groundTruth, new GlobalWeights(this), 2, loo, new int[0]);
groundTruth, new GlobalWeights(this), 2, loo, new int[0], null);
loo.setKnownResult(result);
return loo;
......@@ -635,7 +635,7 @@ public class SimpleData extends Data {
}
if (this.getKnownResult() != null) {
data[0].setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap[0],
new GlobalWeights(data[0]), this.getKnownResult().getNbClusters(), data[0], new int[0]));
new GlobalWeights(data[0]), this.getKnownResult().getNbClusters(), data[0], new int[0], null));
}
data[0].calcStats();
......@@ -651,7 +651,7 @@ public class SimpleData extends Data {
}
if (this.getKnownResult() != null) {
data[1].setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap[1],
new GlobalWeights(data[1]), this.getKnownResult().getNbClusters(), data[1], new int[0]));
new GlobalWeights(data[1]), this.getKnownResult().getNbClusters(), data[1], new int[0], null));
}
data[1].calcStats();
......@@ -683,7 +683,7 @@ public class SimpleData extends Data {
}
if (this.getKnownResult() != null) {
data[i].setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, clusterMap,
new GlobalWeights(data[i]), this.getKnownResult().getNbClusters(), data[i], new int[0]));
new GlobalWeights(data[i]), this.getKnownResult().getNbClusters(), data[i], new int[0], null));
}
data[i].calcStats();
}
......
......@@ -98,6 +98,6 @@ public class RandomData extends SimpleData {
this.setKnownResult(ClusteringResult.gerenerateDefaultClusteringResult(null, result,
new GlobalWeights(new Weights(this.getDataObject(0)
.getNbAttributes())), nbClusters, this, null));
.getNbAttributes())), nbClusters, this, null, null));
}
}
......@@ -314,7 +314,7 @@ public class ARFFReader extends DataFileReader {
final Data data = this.getData();
final ClusteringResult result = ClusteringResult.gerenerateDefaultClusteringResult(null,
this.getKnownResult(), new GlobalWeights(data),
this.getNbClusters(), data, null);
this.getNbClusters(), data, null, null);
/**
* TODO mal => utiliser getKnowResultLegend(), j'ai besoin de
* setLegend(String[]) dans ClassificationResult
......@@ -362,7 +362,7 @@ public class ARFFReader extends DataFileReader {
if (this.hasKnownResult()) {
final ClusteringResult result = ClusteringResult.gerenerateDefaultClusteringResult(null,
this.getKnownResult(), new GlobalWeights(data),
this.getNbClusters(), data, null);
this.getNbClusters(), data, null, null);
result.setClustersNames(this.knownResultValues);
data.setKnownResult(result);
}
......
......@@ -168,7 +168,7 @@ public class XmlResultReader extends DataFileReader {
.getClassColors().length, data);
final ClusteringResult result = ClusteringResult.gerenerateDefaultClusteringResult(null, this
.getResult(), weights, this.getClassColors().length, data,
null);
null, null);
for (int i = 0; i < this.getClassColors().length; i++) {
result.setColor(i, this.getClassColors()[i]);
result.setClusterName(i, this.getClassNames()[i]);
......
......@@ -24,7 +24,7 @@ public abstract class LearningParameters implements Serializable {
// indique si on utilise ou non la classif hierarchique
public boolean hClustering = false;
private Vector<DataObject> samples = null;
private Vector<DataObject> samples = null;
/**
*
......
package jcl.learning;
import java.awt.Color;
import java.io.Serializable;
import java.util.List;
import jcl.Classification;
import jcl.clustering.ClusteringResult;
import jcl.data.Data;
import jcl.utils.exceptions.JCLFormatException;
import jcl.utils.exceptions.MethodNotImplementedException;
import jcl.weights.ClassificationWeights;
......@@ -20,25 +24,28 @@ import jcl.weights.ClassificationWeights;
public abstract class LearningResult extends Object implements Serializable {
/** */
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
/** Parametres utilises pour obtenir ce resultat */
protected LearningParameters params = null;
protected LearningParameters params = null;
/**
* Liste des indices de qualite disponibles pour cette methode de
* classification
*/
protected int qualityIndices[] = null;
protected int qualityIndices[] = null;
/** Ponderations utilisees pour obtenir ce resultat d'apprentissage */
protected ClassificationWeights weights = null;
protected ClassificationWeights weights = null;
/** meilleur résultat depuis le début de la classification */
protected double[] bestFitness = { -1, -1, -1 };
protected double[] bestFitness = { -1, -1, -1 };
/** the related Data */
protected Data data;
protected Data data;
/** allow to specify a specific set of colors to all clustering result generated by this model */
protected List<Color> colors = null;
/**
* <p>
......@@ -59,6 +66,14 @@ public abstract class LearningResult extends Object implements Serializable {
this.setQualityIndices();
this.data = data;
}
/**
* Empty constructor, only used for {@link #ImportResult(String) ImportResult} method
*
*/
protected LearningResult(String dummy) {
}
/**
* <p>
......@@ -72,6 +87,22 @@ public abstract class LearningResult extends Object implements Serializable {
* @return classification result
*/
public abstract ClusteringResult classify(Data data, boolean fromSample);
/**
* <p>
* Method to classify a Data from a classification model.
* It is run on the whole Data, to run it on the sample use the
* {@link #classify(Data, boolean) classify(Data, boolean)} method
* </p>
*
* @param data
* data to classify
* @return classification result
*/
public ClusteringResult classify(Data data) {
return classify(data, false);
}
/**
* Suppression des objets inutiles
......@@ -94,6 +125,14 @@ public abstract class LearningResult extends Object implements Serializable {
return this.qualityIndices;
}
/**
* <p>
* Methode abstraite d'initialisation des indices de qualite disponibles
* pour cette methode de classification.
* </p>
*/
protected abstract void setQualityIndices();
/**
* @return le poids sur les attributs