Class AbstractDensityBasedClusterer

    • Constructor Detail

      • AbstractDensityBasedClusterer

        public AbstractDensityBasedClusterer()
    • Method Detail

      • clusterPriors

        public abstract double[] clusterPriors()
                                        throws java.lang.Exception
        Returns the prior probability of each cluster.
        Specified by:
        clusterPriors in interface DensityBasedClusterer
        Returns:
        the prior probability for each cluster
        Throws:
        java.lang.Exception - if priors could not be returned successfully
      • logDensityPerClusterForInstance

        public abstract double[] logDensityPerClusterForInstance​(Instance instance)
                                                          throws java.lang.Exception
        Computes the log of the conditional density (per cluster) for a given instance.
        Specified by:
        logDensityPerClusterForInstance in interface DensityBasedClusterer
        Parameters:
        instance - the instance to compute the density for
        Returns:
        an array containing the estimated densities
        Throws:
        java.lang.Exception - if the density could not be computed successfully
      • logDensityForInstance

        public double logDensityForInstance​(Instance instance)
                                     throws java.lang.Exception
        Computes the density for a given instance.
        Specified by:
        logDensityForInstance in interface DensityBasedClusterer
        Parameters:
        instance - the instance to compute the density for
        Returns:
        the density.
        Throws:
        java.lang.Exception - if the density could not be computed successfully
      • logJointDensitiesForInstance

        public double[] logJointDensitiesForInstance​(Instance inst)
                                              throws java.lang.Exception
        Returns the logs of the joint densities for a given instance.
        Specified by:
        logJointDensitiesForInstance in interface DensityBasedClusterer
        Parameters:
        inst - the instance
        Returns:
        the array of values
        Throws:
        java.lang.Exception - if values could not be computed
      • makeCopies

        public static DensityBasedClusterer[] makeCopies​(DensityBasedClusterer model,
                                                         int num)
                                                  throws java.lang.Exception
        Creates copies of the current clusterer. Note that this method now uses Serialization to perform a deep copy, so the Clusterer object must be fully Serializable. Any currently built model will now be copied as well.
        Parameters:
        model - an example clusterer to copy
        num - the number of clusterer copies to create.
        Returns:
        an array of clusterers.
        Throws:
        java.lang.Exception - if an error occurs