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

      • getSupport

        public int getSupport()
        Method to obtain the support of a pattern
        Returns:
        the support as an integer.
      • toString

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

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

        public Pattern clonePattern()
        It clones this pattern.
        Returns:
        a clone of the pattern.
      • getElements

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

        public ItemAbstractionPair getIthElement(int i)
        It obtains the Ith element of the pattern
        Parameters:
        i - the position i
        Returns:
        the 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 -
      • size

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

        public int compareTo(Pattern arg)
        This methods compares this pattern with another pattern according to the lexical order. We use a lexicographic order.
        Specified by:
        compareTo in interface java.lang.Comparable<Pattern>
        Parameters:
        arg - the other pattern
        Returns:
        -1 if this pattern is smaller, 0 if equals, otherwise 1.
      • equals

        public boolean equals(java.lang.Object arg)
        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.
      • setAppearingIn

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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.