/** * Initialize with the fartherst first centers * * @param data the training data * @throws Exception if a problem occurs */ protected void farthestFirstInit(Instances data) throws Exception { FarthestFirst ff = new FarthestFirst(); ff.setNumClusters(m_NumClusters); ff.buildClusterer(data); m_ClusterCentroids = ff.getClusterCentroids(); }
/** * Initialize with the fartherst first centers * * @param data the training data * @throws Exception if a problem occurs */ protected void farthestFirstInit(Instances data) throws Exception { FarthestFirst ff = new FarthestFirst(); ff.setNumClusters(m_NumClusters); ff.buildClusterer(data); m_ClusterCentroids = ff.getClusterCentroids(); }
/** * Parses a given list of options. * <p/> * <!-- options-start --> * Valid options are: <p/> * * <pre> -N <num> * number of clusters. (default = 2).</pre> * * <pre> -S <num> * Random number seed. * (default 1)</pre> * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String optionString = Utils.getOption('N', options); if (optionString.length() != 0) { setNumClusters(Integer.parseInt(optionString)); } super.setOptions(options); Utils.checkForRemainingOptions(options); }
/** * Parses a given list of options. * <p/> * <!-- options-start --> * Valid options are: <p/> * * <pre> -N <num> * number of clusters. (default = 2).</pre> * * <pre> -S <num> * Random number seed. * (default 1)</pre> * <!-- options-end --> * * @param options the list of options as an array of strings * @throws Exception if an option is not supported */ @Override public void setOptions(String[] options) throws Exception { String optionString = Utils.getOption('N', options); if (optionString.length() != 0) { setNumClusters(Integer.parseInt(optionString)); } super.setOptions(options); Utils.checkForRemainingOptions(options); }