Main Page | Class Hierarchy | Class List | Class Members

kddml.Core.DataMining.SequentialPatterns.Sequence Class Reference

Inheritance diagram for kddml.Core.DataMining.SequentialPatterns.Sequence:

kddml.Core.DataMining.SequentialPatterns.SequenceManager List of all members.

Public Member Functions

 Sequence (SequenceElement element)
 Sequence (Sequence sm)
boolean addElement (SequenceElementManager el)
boolean addElement (DelimiterManager d, SequenceElementManager el)
boolean isSupported (DataSequenceManager dseq)
TimestampedTransactionManager[] coveringTransactions (DataSequenceManager dseq) throws AssociationModelException
TimestampedTransactionManager[] coarseCoveringTransactions (DataSequenceManager dseq)
boolean contains (SequenceManager sm)
boolean contains (SequenceElementManager element)
boolean equals (Object sequence)
int getNumberOfElements ()
int getNumberOfItems ()
Integer getOccurrence ()
Iterator sequenceIterator ()
Iterator getElements ()
Double getSupport ()
void setOccurrence (Integer occurrence)
void setSupport (Double support)
String toString ()
SequenceManager subSequence (int from, int to)
DelimiterManager getPrecedingDelimiter (int index)
void append (DelimiterManager delimiter, SequenceManager sequence)
void append (SequenceManager sequence)
SequenceManager copy ()
int hashCode ()
weka.core.Instance toInstance (weka.core.Instances dataset) throws IllegalArgumentException

Static Public Member Functions

static SequenceManager fromInstance (weka.core.Instance inst) throws IllegalArgumentException

Detailed Description

A sequence consists of:
  1. Optional attributes (support and occurrence);
  2. A list of sets composing the sequences (SequenceElementManager);
A sequence is structured as a set of consecutive elements (SequenceElementManager). Each of this elements is separated by the one that follows with a delimiter (DelimiterManager). As this class represent a sequential pattern, only UNKNOWN delimiter type is supported.

A sequence must contain at least one element. To force this concept, basic constructor require a SequenceElementManager as parameter. Each following element, must be preceded by a delimiter, that specify the kind of relation between the elements. Again, here, to force this concept, the addElement() method, require both delimiter and element.

Title: KDDML

Description: Knowledge Discovery in Database Environment

Copyright: Copyright (c) 2004

Company: Universita' di Pisa - Dipartimento di Informatica

Author:
Daniele Cerra (daniele@cerra.info)
Version:
2.0.0 alfa


Constructor & Destructor Documentation

kddml.Core.DataMining.SequentialPatterns.Sequence.Sequence SequenceElement  element  ) 
 

Builds a sequence with one element.

Parameters:
element sequence element that forms this sequence

kddml.Core.DataMining.SequentialPatterns.Sequence.Sequence Sequence  sm  ) 
 

Builds a new sequence composed by elements present in given sequence. Support and occurrence are the same as given sequence.

Parameters:
sm input sequence


Member Function Documentation

boolean kddml.Core.DataMining.SequentialPatterns.Sequence.addElement SequenceElementManager  el  ) 
 

Adds an element to this sequence. The DEFAULT delimiter (see DelimiterType) is added between given and previous element.

Parameters:
el new element to be added
Returns:
true if element is added, false otherwise

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

boolean kddml.Core.DataMining.SequentialPatterns.Sequence.addElement DelimiterManager  d,
SequenceElementManager  el
 

Adds an element to this sequence.

Parameters:
d delimiter between last element and the new one
el new element to be added
Returns:
true if element is added, false otherwise

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

boolean kddml.Core.DataMining.SequentialPatterns.Sequence.isSupported DataSequenceManager  dseq  ) 
 

Check if given data sequence support this sequence.

For each element e in this sequence, there is a transaction t such that e.isSupported(t) holds true, and is respected element order. E.g. s = (e1)...(em); d = (t1)...(tn) 1) m <= n 2) e(1).isSupported(ti) => e(2).isSupported(tj) , j > i

Parameters:
dseq data sequence to be checked
Returns:
true if given data sequence support this sequence, false otherwise

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

TimestampedTransactionManager [] kddml.Core.DataMining.SequentialPatterns.Sequence.coveringTransactions DataSequenceManager  dseq  )  throws AssociationModelException
 

This method return only those transactions (and relative items, i.e. only items in transactions that match items in sequence elements) in given data sequence, that support the sequence. If a sequence is not supported by given data sequence, this method return null.
This method works exactly as isSupported(DataSequenceManager dseq), except that instead of only checking which transactions support sequence elements, it return those transactions.

Parameters:
dseq DataSequenceManager data sequence to be checked
Returns:
TimestampedTransactionManager[] the set of transactions that support this sequence, or null if sequence is not supported
Exceptions:
AssociationModelException 

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

TimestampedTransactionManager [] kddml.Core.DataMining.SequentialPatterns.Sequence.coarseCoveringTransactions DataSequenceManager  dseq  ) 
 

This method return only those transactions in given data sequence, that support the sequence. Differently from coveringTransactions() method, this method return all items in those transactions, i.e. not only items in transaction that match items in sequence elements. If sequence is not support by given data sequence, this method return null.

This method works exactly as isSupported(DataSequenceManager dseq), except that instead of only checking which transactions support sequence elements, it return those transactions.

Parameters:
dseq data sequence to be checked
Returns:
the set of transactions that support this sequence, or null if sequence is not supported

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

boolean kddml.Core.DataMining.SequentialPatterns.Sequence.contains SequenceManager  sm  ) 
 

Check if given sequence is contained in this one, i.e. if given sequence is a subset of this one. This method, also return true, if given sequence is equals to this one.

Parameters:
sm sequence to be checked
Returns:
true if sequence is contained, false otherwise

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

boolean kddml.Core.DataMining.SequentialPatterns.Sequence.contains SequenceElementManager  element  ) 
 

Check if given sequence element belong to this sequence. This method return only if sequence element is equal to one in this sequence.

Parameters:
element sequence element to be checked
Returns:
true if sequence element belong to this sequene, false otherwise

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

boolean kddml.Core.DataMining.SequentialPatterns.Sequence.equals Object  sequence  ) 
 

Test if two sequence are equals. To be equals, sequences must have the same elements in the same order, and the same delimiters between elements.

Parameters:
sequence sequence to be checked
Returns:
true if objects are equals, false otherwise

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

int kddml.Core.DataMining.SequentialPatterns.Sequence.getNumberOfElements  ) 
 

Return the numbers of element in this sequence.

Returns:
number of element

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

int kddml.Core.DataMining.SequentialPatterns.Sequence.getNumberOfItems  ) 
 

Return the numbers of items in all element of this sequence.

Returns:
total umber of items

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

Integer kddml.Core.DataMining.SequentialPatterns.Sequence.getOccurrence  ) 
 

Return the numbers of objects in the data for which this sequence holds true.

Returns:
number of occurrence

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

Iterator kddml.Core.DataMining.SequentialPatterns.Sequence.sequenceIterator  ) 
 

Return an iterator over all object in sequence; this include both elements and delimiters. Objects are returned in the order as they are added to the sequence. Remember that each sequence element, except the last, is followed by a DelimiterManager, so a sequence iterator return a sequence of objects like: seq_element_obj, delimiter_obj, seq_element_obj, delimiter_obj, ...

Returns:
iterator over all objects in sequence

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

Iterator kddml.Core.DataMining.SequentialPatterns.Sequence.getElements  ) 
 

Return an iterator over all elements in sequence. Delimiters object excluded. Elements are returned in the order as they are added to the sequence.

Returns:
iterator over all elements in sequence

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

Double kddml.Core.DataMining.SequentialPatterns.Sequence.getSupport  ) 
 

Return the ratio of the number of objects in the data for which this sequence holds true, to the total number of objects in the data.

Returns:
sequence support

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

void kddml.Core.DataMining.SequentialPatterns.Sequence.setOccurrence Integer  occurrence  ) 
 

Update number of occurrence

Parameters:
occurrence new occurence

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

void kddml.Core.DataMining.SequentialPatterns.Sequence.setSupport Double  support  ) 
 

Update sequence support. Support must between 0 and 1 inclusive.

Parameters:
support new support

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

String kddml.Core.DataMining.SequentialPatterns.Sequence.toString  ) 
 

Return a string representation of this object.

Returns:
this object as string

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

SequenceManager kddml.Core.DataMining.SequentialPatterns.Sequence.subSequence int  from,
int  to
 

Return a subsequence starting at index "from" inclusive and ending at index "to" excluded. Returned sequence doesn't have neither support nor occurence. Index range is [0 - number of elements]. Calling sequence.subSequence(0, sequence.getNumberOfElements()) return a copy of sequence.

Parameters:
from start index (inclusive)
to end index (excluded)
Returns:
subsequence

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

DelimiterManager kddml.Core.DataMining.SequentialPatterns.Sequence.getPrecedingDelimiter int  index  ) 
 

Return delimiter object that precedes element with specified index. This method could be useful in conjunction with subSequence() method. Index range is [0, number of elements].

Parameters:
index element index
Returns:
delimiter

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

void kddml.Core.DataMining.SequentialPatterns.Sequence.append DelimiterManager  delimiter,
SequenceManager  sequence
 

Append a sequence to the end of this one. Delimiter is used between old and new sequence elements.

Parameters:
delimiter a delimiter between old and new eleements
sequence sequence to be appended

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

void kddml.Core.DataMining.SequentialPatterns.Sequence.append SequenceManager  sequence  ) 
 

Append a sequence to the end of this one. The DEFAULT delimiter (see DelimiterType) is added between given and previous sequence.

Parameters:
sequence sequence to be appended

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

SequenceManager kddml.Core.DataMining.SequentialPatterns.Sequence.copy  ) 
 

Make a shallow copy of this sequence. Copy a sequence, mean copy the structure, support and occurrence; elements themselves are not copied.

Returns:
new sequence

Implements kddml.Core.DataMining.SequentialPatterns.SequenceManager.

int kddml.Core.DataMining.SequentialPatterns.Sequence.hashCode  ) 
 

Return the hash code of this sequence.

Returns:
hash code

weka.core.Instance kddml.Core.DataMining.SequentialPatterns.Sequence.toInstance weka.core.Instances  dataset  )  throws IllegalArgumentException
 

Return a representation of this sequence as an Instance. The instance have 6 fields representing:

  1. the sequence as string -- see fromInternalFormat() method (attribute sequence);
  2. the support of sequence (attribute sequence_support).
  3. the length of sequence (attribute sequence_cardinality);
  4. the number of distinct items (attribute sequence_distinct_items_cardinality).
  5. the maximum number of items per set (attribute max_number_of_items_per_set).

This method check if the given dataset is compatible with the instance. Valid dataset must have at least following attribute:

Attribute attr1 = new Attribute("sequence", null); Attribute attr2 = new Attribute("sequence_support"); Attribute attr3 = new Attribute("sequence_cardinality"); Attribute attr4 = new Attribute("sequence_distinct_items_cardinality"); Attribute attr5 = new Attribute("max_number_of_items_per_set");

FastVector attributes = new FastVector(); attributes.addElement(attr1); attributes.addElement(attr2); attributes.addElement(attr3); attributes.addElement(attr4); attributes.addElement(attr5);

Instances ris = new Instances("instances_name", attributes, 0);

Attributes may have any order. If given dataset contain other attributes, they are ignored; this mean that attributes value remain undefined.

Note that overriding this method, following methods must be overrided too:

  • toInstance , used to reverse this process;
  • fromInternalFromat , used to reverse internal format

Parameters:
dataset dataset
Returns:
this sequence as Instance object
Exceptions:
IllegalArgumentException if given dataset doesn't contain specified attributes

static SequenceManager kddml.Core.DataMining.SequentialPatterns.Sequence.fromInstance weka.core.Instance  inst  )  throws IllegalArgumentException [static]
 

Transform an instance into a sequence object. Given instance must have at least 2 fields, representing:

  1. the sequence as string -- conform to fromInternalFormat() method -- (attribute sequence: required);
  2. the support of sequence (attribute sequence_support: may be missing). Other field are allowed, but ignored. See toInstance() method for other details.

Returns:
sequence object
Parameters:
inst sequence as instance
Exceptions:
IllegalArgumentException If given instance doesn't have access to it's dataset, or specififed attributes are not present/missing, or sequence format cannot be parsed


Generated on Thu Feb 23 13:04:42 2006 for kddml by  doxygen 1.4.3