Documentation of 'ca.pfv.spmf.algorithms.associationrules.TopKRules_and_TNR.Database' Java class
Database
ca.pfv.spmf.algorithms.associationrules.TopKRules_and_TNR

Class Database



  • public class Database
    extends java.lang.Object
    This class represents a transaction database optimized for the TNR and TopKRules algorithms for top-k association rule mining.

    It contains a list of transaction implemented as linked-lists and keep track of the largest item ids and the total number of transactions in the database.

    The main method is loadFile() for reading a file. But transactions can also be added manually by calling the method addTransaction.
    See Also:
    AlgoTNR, AlgoTopKRules, Transaction
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      int maxItem
      the largest item in the database
      int tidsCount
      the number of transactions in the database
    • Constructor Summary

      Constructors 
      Constructor and Description
      Database() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addTransaction(java.lang.String[] itemsString)
      Read a transaction from the file and store it into memory
      java.util.List<Transaction> getTransactions()
      Get the list of transactions in this database.
      void loadFile(java.lang.String path)
      Load a file from a file path.
      int size()
      Get the number of transactions.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • maxItem

        public int maxItem
        the largest item in the database
      • tidsCount

        public int tidsCount
        the number of transactions in the database
    • Constructor Detail

      • Database

        public Database()
    • Method Detail

      • loadFile

        public void loadFile(java.lang.String path)
                      throws java.io.IOException
        Load a file from a file path.
        Parameters:
        path - the input file path
        Throws:
        java.io.IOException - exception if an error while writing the file
      • addTransaction

        public void addTransaction(java.lang.String[] itemsString)
        Read a transaction from the file and store it into memory
        Parameters:
        itemsString - an array of items, where an item is an integer represented as a String.
      • size

        public int size()
        Get the number of transactions.
        Returns:
        the number of transactions
      • getTransactions

        public java.util.List<Transaction> getTransactions()
        Get the list of transactions in this database.
        Returns:
        a List of Transactions

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.