/** * Adds an instance to the Cobweb tree. * * @param newInstance the instance to be added * @throws Exception if something goes wrong * @deprecated updateClusterer(Instance) should be used instead * @see #updateClusterer(Instance) */ @Deprecated public void addInstance(Instance newInstance) throws Exception { updateClusterer(newInstance); }
/** * Adds an instance to the Cobweb tree. * * @param newInstance the instance to be added * @throws Exception if something goes wrong * @deprecated updateClusterer(Instance) should be used instead * @see #updateClusterer(Instance) */ @Deprecated public void addInstance(Instance newInstance) throws Exception { updateClusterer(newInstance); }
/** * Builds the clusterer. * * @param data the training instances. * @throws Exception if something goes wrong. */ @Override public void buildClusterer(Instances data) throws Exception { m_numberOfClusters = -1; m_cobwebTree = null; m_numberSplits = 0; m_numberMerges = 0; // can clusterer handle the data? getCapabilities().testWithFail(data); // randomize the instances data = new Instances(data); if (getSeed() >= 0) { data.randomize(new Random(getSeed())); } for (int i = 0; i < data.numInstances(); i++) { updateClusterer(data.instance(i)); } updateFinished(); }
/** * Builds the clusterer. * * @param data the training instances. * @throws Exception if something goes wrong. */ @Override public void buildClusterer(Instances data) throws Exception { m_numberOfClusters = -1; m_cobwebTree = null; m_numberSplits = 0; m_numberMerges = 0; // can clusterer handle the data? getCapabilities().testWithFail(data); // randomize the instances data = new Instances(data); if (getSeed() >= 0) { data.randomize(new Random(getSeed())); } for (int i = 0; i < data.numInstances(); i++) { updateClusterer(data.instance(i)); } updateFinished(); }