Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP.items.patterns.Pattern' Java class
Pattern
ca.pfv.spmf.algorithms.sequentialpatterns.clospan_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
      • Pattern

        public Pattern(java.util.List<ItemAbstractionPair> elements)
        New pattern from a list of pairs
        Parameters:
        elements -
      • Pattern

        public Pattern(ItemAbstractionPair pair)
        New pattern from a single pair
        Parameters:
        pair -
    • Method Detail

      • toString

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

        public java.lang.String toStringToFile()
        Get the string representation of this itemset in SPMF format.
        Returns:
        the string representation
      • clonePatron

        public Pattern clonePatron()
        It clones a pattern
        Returns:
        the clone
      • getElements

        public java.util.List<ItemAbstractionPair> getElements()
        It obtains the elements of the pattern
        Returns:
        the list of elements
      • getIthElement

        public ItemAbstractionPair getIthElement(int i)
        It obtains the Ith element of the pattern
        Parameters:
        i - the position
        Returns:
        the ith element
      • getLastElement

        public ItemAbstractionPair getLastElement()
        It obtains the last element of the pattern
        Returns:
        the last element
      • setElements

        public void setElements(java.util.List<ItemAbstractionPair> elements)
        Setter method to set the elements of the pattern
        Parameters:
        elements -
      • add

        public void add(ItemAbstractionPair pair)
        It adds an item with its abstraction in the pattern. The new pair is added in the last position of the pattern.
        Parameters:
        pair - the pair to be added
      • size

        public int size()
        It returns the number of items contained in the pattern
        Returns:
        the number of items
      • compareTo

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

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.util.BitSet getAppearingIn()
        It returns the list of sequence IDs where the pattern appears.
        Returns:
        the list of sequence ids as a bitset
      • setAppearingIn

        public void setAppearingIn(java.util.BitSet ids)
        It sets the list of sequence IDs where the pattern appears.
        Parameters:
        ids - a list of sequence ids
      • isSubpattern

        public boolean isSubpattern(AbstractionCreator abstractionCreator,
                                    Pattern p)
        Check if the current Pattern is a subpattern of another one given as parameter.
        Parameters:
        abstractionCreator - an instance of an abstraction creator
        p - the other pattern
        Returns:
        true if this pattern is a subpattern. Otherwise, false.
      • getSupport

        public int getSupport()
        Method to obtain the support of a pattern
        Returns:
        the support
      • setSupport

        public void setSupport(int support)
        Method to set the support of this pattern
        Parameters:
        support - as an integer value
      • getSumIdSequences

        public int getSumIdSequences()
        Get the sum of all the sequence identifiers that are present in the support of this pattern.
        Returns:
        the sum of the ids.
      • setSumIdSequences

        public void setSumIdSequences(int sumIdSequences)
        Set the value for the addition of all the sequence identifiers that are present in the support of this pattern
        Parameters:
        sumIdSequences - the sum
      • concatenate

        public Pattern concatenate(ItemAbstractionPair pair)
        It concatenates the given pair as a last element of the pattern
        Parameters:
        pair - the pair
        Returns:
        the resulting pattern
      • concatenate

        public Pattern concatenate(Pattern pattern)
        It concatenates the given pattern to the current pattern
        Parameters:
        pattern - the pattern
        Returns:
        the resulting pattern

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.