Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.prefixSpan_AGP.items.PseudoSequence' Java class
PseudoSequence
ca.pfv.spmf.algorithms.sequentialpatterns.prefixSpan_AGP.items

Class PseudoSequence



  • public class PseudoSequence
    extends java.lang.Object
    This class represents a sequence from a projected database (as based in PrefixSpan). Since it is a projected sequence, it makes reference to the original sequence. This class is inspired in SPMF PrefixSpan implementation. 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 Summary

      Constructors 
      Constructor and Description
      PseudoSequence(long timeShift, PseudoSequence pseudosequence, int itemsetIndex, int itemIndex, int firstItemset)
      It make a pseudosequence from a previous pseudosequence.
      PseudoSequence(long timeShift, Sequence sequence, int itemsetIndex, int itemIndex)
      PseudoSequence made from a starndard sequence.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addProjectionPoint(int firstItemset, long timeShift, PseudoSequence pseudosequence, int itemsetIndex, int itemIndex)
      Method to make a projection in a pseudosequence already projected.
      long getAbsoluteTimeStamp(int itemsetIndex, int firstItemset)
      It obtains the original timestamp for that itemset
      int getBeginningOfItemset(int firstItem, int itemsetIndex)
      It returns the first item of the first itemset of the specified projection
      int getFirstItemset(int index)
      It returns the first itemset of the projection, in absolute terms
      int getId()
      Get the pseudosequence ID
      Item getItemAtInItemsetAt(int firstItem, int itemIndex, int itemsetIndex)
      Get a given item of an itemset
      Itemset getItemset(int itemsetIndex, int firstitemset)
      It gets the itemset in the original sequence.
      long getRelativeTimeStamp(int itemsetIndex, int firstItemset)
      It obtains the relative timestamp
      int getSizeOfItemsetAt(int firstItemset, int index)
      It returns the size of the itemset in a specified projection of the sequence
      long getTimeShift(int firstItemset)
      It gets the timeShift for a specified projection of the pseudosequence
      int indexOf(int firstItemset, int itemsetIndex, Item item)
      It returns the index where an item appears in the specified itemset of the specified projection of the current pseudosequence.
      boolean isFirstItemset(int index)
      To know if an itemset is the first one
      boolean isPostfix(int firstItem, int itemsetIndex)
      It informs if a projection it starts in the midle of an itemset
      int numberOfProjectionsIncluded()
      It returns the number of projections included in this pseudosequence
      int size(int i)
      It returns the size for the current pseudosequence
      java.lang.String toString()
      Get the string representation of this pseudosequence
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PseudoSequence

        public PseudoSequence(long timeShift,
                              PseudoSequence pseudosequence,
                              int itemsetIndex,
                              int itemIndex,
                              int firstItemset)
        It make a pseudosequence from a previous pseudosequence. Therefore, we are making a projection in a previous projection and we have to take into account the previous index of that projection to establish the ours.
        Parameters:
        timeShift - The time shift of the new pseudosequence
        pseudosequence - The pseudosequence where we make another projection
        itemsetIndex - The itemset index where our new projection is starting
        itemIndex - The item index where our new projection is starting
        firstItemset - An index that indicates in which projection of the previous pseudoseuqence we are making the new pseudosequence
      • PseudoSequence

        public PseudoSequence(long timeShift,
                              Sequence sequence,
                              int itemsetIndex,
                              int itemIndex)
        PseudoSequence made from a starndard sequence. Its purpose is make possible the later projections
        Parameters:
        timeShift - The original timeshift (Normally, it will be 0)
        sequence - The original standard sequence
        itemsetIndex - The itemset index where the projection it starts
        itemIndex - The item index where the projection it starts
    • Method Detail

      • addProjectionPoint

        public void addProjectionPoint(int firstItemset,
                                       long timeShift,
                                       PseudoSequence pseudosequence,
                                       int itemsetIndex,
                                       int itemIndex)
        Method to make a projection in a pseudosequence already projected. In this way, for a same pseudosequence, we can have several projections. For example, let us think in a sequence A = (a) (a b) (a b c). If we project by item a, we obtain three different projections: 1) (a b) (a b c) 2) (*b) (a b c) 3) (*b c) That we do is to put all the three projections in the same pseudoseuqence, and we refers each projection with an index. We call to every projection, projection point.
        Parameters:
        firstItemset - The projection point of the given pseudosequence where we are making our new projection
        timeShift - The given timeshift for our projection
        pseudosequence - The given pseudosequence where we are making our projection
        itemsetIndex - The itemset index where our projection it starts
        itemIndex - The item index where our projection it starts
      • getFirstItemset

        public int getFirstItemset(int index)
        It returns the first itemset of the projection, in absolute terms
        Parameters:
        index - the ith projection in which we want to know the first itemset
        Returns:
        the item at position index in the first itemset
      • size

        public int size(int i)
        It returns the size for the current pseudosequence
        Parameters:
        i - the ith projection in which we want to know the size
        Returns:
        the size
      • numberOfProjectionsIncluded

        public int numberOfProjectionsIncluded()
        It returns the number of projections included in this pseudosequence
        Returns:
        the number of projections
      • getSizeOfItemsetAt

        public int getSizeOfItemsetAt(int firstItemset,
                                      int index)
        It returns the size of the itemset in a specified projection of the sequence
        Parameters:
        firstItemset - the ith projection in which we are interested
        index - The ith itemset of the current pseudosequence
        Returns:
        the size
      • getBeginningOfItemset

        public int getBeginningOfItemset(int firstItem,
                                         int itemsetIndex)
        It returns the first item of the first itemset of the specified projection
        Parameters:
        firstItem - the specified projection in which we are interested
        itemsetIndex - the itemset of the pseudosequence in which we are interested
        Returns:
        the item
      • isPostfix

        public boolean isPostfix(int firstItem,
                                 int itemsetIndex)
        It informs if a projection it starts in the midle of an itemset
        Parameters:
        firstItem - The projection in which we are interested
        itemsetIndex - The itemset to study
        Returns:
        true if it does. otherwise, false.
      • isFirstItemset

        public boolean isFirstItemset(int index)
        To know if an itemset is the first one
        Parameters:
        index - the position of the itemset
        Returns:
        true if it is the first one, otherwise false
      • getItemAtInItemsetAt

        public Item getItemAtInItemsetAt(int firstItem,
                                         int itemIndex,
                                         int itemsetIndex)
        Get a given item of an itemset
        Parameters:
        firstItem - The projection in which are interested
        itemIndex - The item index
        itemsetIndex - The itemset index
        Returns:
        the item
      • getAbsoluteTimeStamp

        public long getAbsoluteTimeStamp(int itemsetIndex,
                                         int firstItemset)
        It obtains the original timestamp for that itemset
        Parameters:
        itemsetIndex - the itemset index for the pseudosequence
        firstItemset - the projection in which we are interested
        Returns:
        the timestamp
      • getRelativeTimeStamp

        public long getRelativeTimeStamp(int itemsetIndex,
                                         int firstItemset)
        It obtains the relative timestamp
        Parameters:
        itemsetIndex - the itemset index
        firstItemset - the projection in which we are interested
        Returns:
        the timestamp
      • getItemset

        public Itemset getItemset(int itemsetIndex,
                                  int firstitemset)
        It gets the itemset in the original sequence.
        Parameters:
        itemsetIndex - the itemset index
        firstitemset - the projection in which we are interested
        Returns:
        the itemset
      • getId

        public int getId()
        Get the pseudosequence ID
        Returns:
        the ID
      • toString

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

        public int indexOf(int firstItemset,
                           int itemsetIndex,
                           Item item)
        It returns the index where an item appears in the specified itemset of the specified projection of the current pseudosequence. If the item does not appear, it returns -1.
        Parameters:
        firstItemset - the index of the firstItemset to search
        itemsetIndex - the current itemset index
        item - the item
        Returns:
        the index or -1 if the item does not appear
      • getTimeShift

        public long getTimeShift(int firstItemset)
        It gets the timeShift for a specified projection of the pseudosequence
        Parameters:
        firstItemset - the projection in which we are interested
        Returns:
        the timeshift

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.