Class MetaMultilabelGenerator

    • Field Detail

      • binaryGeneratorOption

        public ClassOption binaryGeneratorOption
      • metaRandomSeedOption

        public IntOption metaRandomSeedOption
      • numLabelsOption

        public IntOption numLabelsOption
      • labelCardinalityOption

        public FloatOption labelCardinalityOption
      • labelCardinalityVarOption

        public FloatOption labelCardinalityVarOption
      • labelCardinalityRatioOption

        public FloatOption labelCardinalityRatioOption
      • labelDependencyChangeRatioOption

        public FloatOption labelDependencyChangeRatioOption
      • multilabelStreamTemplate

        protected Instances multilabelStreamTemplate
      • m_MetaRandom

        protected Random m_MetaRandom
      • m_L

        protected int m_L
      • m_A

        protected int m_A
      • priors

        protected double[] priors
      • priors_norm

        protected double[] priors_norm
      • Conditional

        protected double[][] Conditional
      • m_TopCombinations

        protected HashSet[] m_TopCombinations
    • Constructor Detail

      • MetaMultilabelGenerator

        public MetaMultilabelGenerator()
    • Method Detail

      • prepareForUseImpl

        public void prepareForUseImpl​(TaskMonitor monitor,
                                      ObjectRepository repository)
        Description copied from class: AbstractOptionHandler
        This method describes the implementation of how to prepare this object for use. All classes that extends this class have to implement prepareForUseImpl and not prepareForUse since prepareForUse calls prepareForUseImpl.
        Specified by:
        prepareForUseImpl in class AbstractOptionHandler
        Parameters:
        monitor - the TaskMonitor to use
        repository - the ObjectRepository to use
      • generateMultilabelHeader

        protected MultilabelInstancesHeader generateMultilabelHeader​(Instances si)
        GenerateMultilabelHeader.
        Parameters:
        si - single-label Instances
      • modifyPriorVector

        protected double[] modifyPriorVector​(double[] P,
                                             double u,
                                             Random r,
                                             boolean skew)
        ModifyPriorVector. A certain number of values will be altered.
        Parameters:
        P - the prior distribution
        u - the probability of changing P[j]
        r - for random numbers
        skew - NOTE not currently used
        Returns:
        the modified P
      • modifyDependencyMatrix

        protected boolean[][] modifyDependencyMatrix​(boolean[][] M,
                                                     double u,
                                                     Random r)
        ModifyDependencyMatrix. A certain number of values will be altered. @NOTE a future improvement would be to detect cycles, since this may lead to inconsistencies. However, due to the rarity of this occurring, and the minimal problems it would cause (and considering that inconsistencies also occr in real datasets) we don't implement this.
        Parameters:
        M - a boolean matrix
        u - the probability of changing the relationship M[j][k]
        r - for random numbers
        Returns:
        the modified M
      • generateConditional

        protected double[][] generateConditional​(double[] P,
                                                 boolean[][] M)
        GenerateConditional. Given the priors distribution and a matrix flagging dependencies, generate a conditional distribution matrix Q; such that: P(i) = Q[i][i] P(i|j) = Q[i][j]
        Parameters:
        P - prior distribution
        M - dependency matrix (where 1 == dependency)
        Returns:
        Q conditional dependency matrix
      • getHeader

        public InstancesHeader getHeader()
        Description copied from interface: ExampleStream
        Gets the header of this stream. This is useful to know attributes and classes. InstancesHeader is an extension of weka.Instances.
        Specified by:
        getHeader in interface ExampleStream<Example<Instance>>
        Returns:
        the header of this stream
      • estimatedRemainingInstances

        public long estimatedRemainingInstances()
        Description copied from interface: ExampleStream
        Gets the estimated number of remaining instances in this stream
        Specified by:
        estimatedRemainingInstances in interface ExampleStream<Example<Instance>>
        Returns:
        the estimated number of instances to get from this stream
      • hasMoreInstances

        public boolean hasMoreInstances()
        Description copied from interface: ExampleStream
        Gets whether this stream has more instances to output. This is useful when reading streams from files.
        Specified by:
        hasMoreInstances in interface ExampleStream<Example<Instance>>
        Returns:
        true if this stream has more instances to output
      • getDescription

        public void getDescription​(StringBuilder sb,
                                   int indent)
        Description copied from interface: MOAObject
        Returns a string representation of this object. Used in AbstractMOAObject.toString to give a string representation of the object.
        Specified by:
        getDescription in interface MOAObject
        Parameters:
        sb - the stringbuilder to add the description
        indent - the number of characters to indent
      • main

        public static void main​(String[] args)