Class AbstractionCreator_Qualitative


  • public class AbstractionCreator_Qualitative
    extends AbstractionCreator
    Class that implements a qualitative abstraction. Two different values are possible: to be with an equal relation with respect to a previous pair (if occurs at the same time), or to be with an after relation with respect to that previous pair (the previous pair have a before relation with respect to this one) 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 .
    Author:
    agomariz
    • Method Detail

      • sclear

        public static void sclear()
      • crearAbstraccion

        public Abstraction_Generic crearAbstraccion​(boolean hasEqualRelation)
        It creates a relation with the given parameter.
        Parameters:
        hasEqualRelation - The boolean indicatin if the item has an equal relation with the previous item in the pattern
        Returns:
        the created relation
      • getSubpattern

        public Pattern getSubpattern​(Pattern extension,
                                     int index)
        It obtains the subpattern that is derived from removing from the given pattern ,the item specified in the position pointed out by the given index
        Specified by:
        getSubpattern in class AbstractionCreator
        Parameters:
        extension - the pattern
        index - the index
        Returns:
        the subpattern
      • isSubpattern

        public boolean isSubpattern​(Pattern shorter,
                                    Pattern larger,
                                    int index,
                                    java.util.List<java.lang.Integer> positions)
        Method that check if for the two patterns given as parameters, the shortest one is a subpattern of the longest one
        Specified by:
        isSubpattern in class AbstractionCreator
        Parameters:
        shorter - The pattern which we check if is a subpattern of another longer than it
        larger - Pattern which we want to check if another pattern is subpattern of itself
        index - index that indicates which position we have to take into account
        positions - List of positions of the appearances of the elements of the shorter pattern in the longer one
        Returns:
        true if it is a subpattern, otherwise false
      • searchForFirstAppearance

        public java.lang.Integer searchForFirstAppearance​(Pattern p,
                                                          java.lang.Integer beginning,
                                                          Item itemPair)
        Method that search the first appearance of an item (given as parameter) in a pattern, starting from a beginning index
        Parameters:
        p - Pattern where we search for an item
        beginning - Index from which we start to search from the item
        itemPair - Item to search for
        Returns:
        The item position where we found the item, or null if this does not appear
      • findItemPositionInPattern

        public java.lang.Integer findItemPositionInPattern​(Pattern p,
                                                           Item itemPair,
                                                           Abstraction_Generic currentAbs,
                                                           Abstraction_Generic previousAbs,
                                                           java.lang.Integer currentPosition,
                                                           java.lang.Integer previousPosition)
        It searches for a position in the pattern given as parameter where an item, also given as a parameter, appears
        Parameters:
        p - Pattern where we are going to search for
        itemPair - Item to search for
        currentAbs - Abstraction of the current element of the pattern where the item appeared
        previousAbs - Astraction of the previous element of the pattern where the item appeared
        currentPosition - Position for the current element
        previousPosition - Position of the previous element
        Returns:
        the position
      • increasePosition

        public java.lang.Integer increasePosition​(java.lang.Integer beginning)
        It increase the position of a given position by 1.
        Parameters:
        beginning - the position
        Returns:
        the position +1
      • increaseItemset

        public int increaseItemset​(Pattern p,
                                   java.lang.Integer beginning)
        Increase a position to the first element position where it starts another itemset
        Parameters:
        p - Pattern in which we search for the beginning of another itemset
        beginning - Index from which we start to search for
        Returns:
        The item index where a new Itemset starts