Interface Clusterer

    • Method Detail

      • buildClusterer

        void buildClusterer​(Instances data)
                     throws java.lang.Exception
        Generates a clusterer. Has to initialize all fields of the clusterer that are not being set via options.
        Parameters:
        data - set of instances serving as training data
        Throws:
        java.lang.Exception - if the clusterer has not been generated successfully
      • clusterInstance

        int clusterInstance​(Instance instance)
                     throws java.lang.Exception
        Classifies a given instance. Either this or distributionForInstance() needs to be implemented by subclasses.
        Parameters:
        instance - the instance to be assigned to a cluster
        Returns:
        the number of the assigned cluster as an integer
        Throws:
        java.lang.Exception - if instance could not be clustered successfully
      • distributionForInstance

        double[] distributionForInstance​(Instance instance)
                                  throws java.lang.Exception
        Predicts the cluster memberships for a given instance. Either this or clusterInstance() needs to be implemented by subclasses.
        Parameters:
        instance - the instance to be assigned a cluster.
        Returns:
        an array containing the estimated membership probabilities of the test instance in each cluster (this should sum to at most 1)
        Throws:
        java.lang.Exception - if distribution could not be computed successfully
      • numberOfClusters

        int numberOfClusters()
                      throws java.lang.Exception
        Returns the number of clusters.
        Returns:
        the number of clusters generated for a training dataset.
        Throws:
        java.lang.Exception - if number of clusters could not be returned successfully
      • getCapabilities

        Capabilities getCapabilities()
        Returns the Capabilities of this clusterer. Derived classifiers have to override this method to enable capabilities.
        Returns:
        the capabilities of this object
        See Also:
        Capabilities