Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.gsp_AGP.items.patterns.Pattern' Java class
Pattern
ca.pfv.spmf.algorithms.sequentialpatterns.gsp_AGP.items.patterns

Class Pattern

  • All Implemented Interfaces:
    java.lang.Comparable<Pattern>


    public class Pattern
    extends java.lang.Object
    implements java.lang.Comparable<Pattern>
    Implementation of pattern structure. We define it as a list of pairs . Besides, a bitSet appearingIn denotes the sequences where the pattern appears. Copyright Antonio Gomariz Peñalver 2013 This file is part of the SPMF DATA MINING SOFTWARE (http://www.philippe-fournier-viger.com/spmf). SPMF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SPMF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SPMF. If not, see .
    • Constructor Detail

      • Pattern

        public Pattern()
        Standard constructor that sets all the attributes to empty values
      • Pattern

        public Pattern(java.util.List<ItemAbstractionPair> elements)
        Constructor that creates a pattern with the given element list
        Parameters:
        elements - element list
      • Pattern

        public Pattern(ItemAbstractionPair pair)
        Constructor that creates a pattern with the only element passed as a parameter
        Parameters:
        pair -
    • Method Detail

      • toString

        public java.lang.String toString()
        Get the string representation of this itemset
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation
      • toStringToFile

        public java.lang.String toStringToFile()
        Get a string representation of this itemset. Adjusted to SPMF format.
        Returns:
        the string representation
      • clonePattern

        public Pattern clonePattern()
        Method that clones a pattern
        Returns:
        the clone of the pattern
      • getElements

        public java.util.List<ItemAbstractionPair> getElements()
        It gets the components of the patterns in a list of pairs
        Returns:
        the list of pairs
      • getIthElement

        public ItemAbstractionPair getIthElement(int i)
        It gets the ith component from the pattern
        Parameters:
        i - ith index of the element to return
        Returns:
        the element (ItemAbstractionPair)
      • getLastButOneElement

        public ItemAbstractionPair getLastButOneElement()
        It returns the last but one element of the pattern
        Returns:
        the last but one element
      • getLastElement

        public ItemAbstractionPair getLastElement()
        It returns the last element of the pattern
        Returns:
        the last element
      • getNElements

        public java.util.List<ItemAbstractionPair> getNElements(int n)
        It returns the first n elements of the pattern
        Parameters:
        n - an integer n
        Returns:
        the first n elements
      • setElements

        public void setElements(java.util.List<ItemAbstractionPair> elements)
        Setter for the pattern components
        Parameters:
        elements - a list of elements
      • add

        public void add(ItemAbstractionPair pair)
        Add a pair in the last position of the pattern
        Parameters:
        pair - the pair
      • size

        public int size()
        return the pattern size
        Returns:
        the size of the pattern
      • compareTo

        public int compareTo(Pattern arg)
        Compare this pattern to another pattern
        Specified by:
        compareTo in interface java.lang.Comparable<Pattern>
        Parameters:
        arg - the other pattern
        Returns:
        0 if equal, -1 if smaller, otherwise 1
      • equals

        public boolean equals(java.lang.Object arg)
        Check if this pattern is equal to another.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        arg - another pattern
        Returns:
        true if equal, otherwise false.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isPrefix

        public boolean isPrefix(Pattern p)
        It answer to the question of if the current pattern is a prefix of the given pattern
        Parameters:
        p - pattern where we want to check if our current pattern is a prefix
        Returns:
        true if is a positive answer, false otherwise
      • getAppearingIn

        public java.util.BitSet getAppearingIn()
        Return the set of sequence IDs where the pattern appears
        Returns:
        the set as a bitset
      • setAppearingIn

        public void setAppearingIn(java.util.BitSet appearingIn)
      • clear

        public void clear()
      • addAppearance

        public void addAppearance(java.lang.Integer sequenceId)
        Add a sequence ID in the sequence Id set
        Parameters:
        sequenceId - the sequence id
      • getSupport

        public double getSupport()
        It returns the support of a pattern
        Returns:
        the support

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.