Package coconad

Class PSFnPSR

java.lang.Object
coconad.PSFnPSR
All Implemented Interfaces:
util.Executable

public class PSFnPSR extends Object implements util.Executable
Class for Pattern Spectrum Filtering and Pattern Set Reduction. Provides an executable object that can be run as a thread.
Since:
2013.12.10
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    target pattern subtype: all frequent item sets
    static final int
    algorithm variant: basic version (low memory consumption, slow)
    static final int
    surrogate method: dithered blocked permutations
    static final int
    target pattern subtype: all closed (frequent) item sets
    static final int
    algorithm variant: refined version (closed/maximal repository)
    static final int
    surrogate method: event/spike dithering/displacement
    static final int
    surrogate method: estimate pattern spectrum (no surrogates)
    static final int
    algorithm variant: refined version (spike and train filtering)
    static final int
    target pattern subtype: all frequent item sets
    static final int
    random number method: Gaussian density (identical to NORMAL
    static final int
    surrogate method: identity (keep original data)
    static final int
    target pattern type: all frequent item sets
    static final int
    surrogate method: sampling from kernel estimate
    static final int
    target pattern subtype: all maximal (frequent) item sets
    static final int
    surrogate method: none (no pattern spectrum filtering)
    static final int
    random number method: normal density (identical to GAUSS
    static final int
    target pattern type: all frequent item sets
    static final int
    surrogate method: dithered event/spike permutation
    static final int
    surrogate method: event/spike time rendomization
    static final int
    surrogate method: read pattern spectrum from file
    static final int
    random number method: rectangular density (identical to UNIFORM
    static final int
    target pattern type: all closed (frequent) item sets
    static final int
    surrogate method: train shifting/dithering
    static final int
    random number method: triangular density
    static final int
    random number method: uniform density (identical to RECT
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create an object for pattern spectrum filtering and pattern set reduction.
    Create an object for pattern spectrum filtering and pattern set reduction.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Abort the computations (set an abort flag).
    void
    Execute pattern spectrum filtering and pattern set reduction.
    Get the result message of the computations.
    void
    setCoCoNAD(int target, int suborig, int subsurr, double width, int supp, int zmin, int zmax)
    Set the CoCoNAD parameters.
    void
    setCoCoNAD(int target, int suborig, int subsurr, double width, int supp, int zmin, int zmax, int algo, int mode)
    Set the CoCoNAD parameters.
    void
    setCPUs(int cpus)
    Set the number of CPUs/threads to use.
    void
    setEstimate(int equiv, double alpha, int smpls)
    Set the pattern spectrum estimation parameters.
    void
    setEstimate(int equiv, double alpha, int smpls, int seed)
    Set the pattern spectrum estimation parameters.
    void
    setOutput(String fn_out)
    Set the pattern output file name.
    void
    setOutput(String fn_out, String header, String itemsep, String outfmt)
    Set the pattern output file name and the format strings.
    void
    setRange(double beg, double end)
    Set the (allowed) range of points/spike times.
    void
    setReduction(int psr)
    Set the pattern set reduction method.
    void
    Set the name of the pattern spectrum file.
    void
    setSpectrum(String fn_psp, String pspsep)
    Set the name of the pattern spectrum file.
    void
    setSpectrum(table.Table spectrum)
    Set the pattern spectrum.
    void
    setSurrogate(int cnt, int surr, int rand, double sigma, double delta)
    Set the surrogate data parameters.
    void
    setSurrogate(int cnt, int surr, int rand, double sigma, double delta, int seed)
    Set the surrogate data parameters.
    void
    Set the train set to analyze.
    void
    setTrains(String fn_tns)
    Set the name of the train set file.
    void
    setTrains(String fn_tns, int mode)
    Set the name of the train set file and the record contents mode.
    void
    setTrains(String fn_tns, String recseps, String fldseps, String blanks, String comment, int mode)
    Set the name of the train set file, the structure characters, and the record contents mode.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ITEMSET

      public static final int ITEMSET
      target pattern type: all frequent item sets
      See Also:
    • PERMUTATION

      public static final int PERMUTATION
      target pattern type: all frequent item sets
      See Also:
    • SEQUENCE

      public static final int SEQUENCE
      target pattern type: all closed (frequent) item sets
      See Also:
    • FREQUENT

      public static final int FREQUENT
      target pattern subtype: all frequent item sets
      See Also:
    • ALL

      public static final int ALL
      target pattern subtype: all frequent item sets
      See Also:
    • CLOSED

      public static final int CLOSED
      target pattern subtype: all closed (frequent) item sets
      See Also:
    • MAXIMAL

      public static final int MAXIMAL
      target pattern subtype: all maximal (frequent) item sets
      See Also:
    • BASIC

      public static final int BASIC
      algorithm variant: basic version (low memory consumption, slow)
      See Also:
    • FILTER

      public static final int FILTER
      algorithm variant: refined version (spike and train filtering)
      See Also:
    • CMREPO

      public static final int CMREPO
      algorithm variant: refined version (closed/maximal repository)
      See Also:
    • NONE

      public static final int NONE
      surrogate method: none (no pattern spectrum filtering)
      See Also:
    • READ

      public static final int READ
      surrogate method: read pattern spectrum from file
      See Also:
    • ESTIMATE

      public static final int ESTIMATE
      surrogate method: estimate pattern spectrum (no surrogates)
      See Also:
    • IDENTITY

      public static final int IDENTITY
      surrogate method: identity (keep original data)
      See Also:
    • RANDOM

      public static final int RANDOM
      surrogate method: event/spike time rendomization
      See Also:
    • DITHER

      public static final int DITHER
      surrogate method: event/spike dithering/displacement
      See Also:
    • SHIFT

      public static final int SHIFT
      surrogate method: train shifting/dithering
      See Also:
    • KERNEST

      public static final int KERNEST
      surrogate method: sampling from kernel estimate
      See Also:
    • PERMUTE

      public static final int PERMUTE
      surrogate method: dithered event/spike permutation
      See Also:
    • BLOCK

      public static final int BLOCK
      surrogate method: dithered blocked permutations
      See Also:
    • UNIFORM

      public static final int UNIFORM
      random number method: uniform density (identical to RECT
      See Also:
    • RECT

      public static final int RECT
      random number method: rectangular density (identical to UNIFORM
      See Also:
    • TRIANG

      public static final int TRIANG
      random number method: triangular density
      See Also:
    • GAUSS

      public static final int GAUSS
      random number method: Gaussian density (identical to NORMAL
      See Also:
    • NORMAL

      public static final int NORMAL
      random number method: normal density (identical to GAUSS
      See Also:
  • Constructor Details

    • PSFnPSR

      public PSFnPSR()
      Create an object for pattern spectrum filtering and pattern set reduction.
      Since:
      2013.12.10 (Christian Borgelt)
    • PSFnPSR

      public PSFnPSR(ActionListener progrep)
      Create an object for pattern spectrum filtering and pattern set reduction.
      Parameters:
      progrep - the progress reporter
      Since:
      2013.12.10 (Christian Borgelt)
  • Method Details

    • setTrains

      public void setTrains(String fn_tns)
      Set the name of the train set file.
      Parameters:
      fn_tns - the name of the train set file
      Since:
      2013.12.10 (Christian Borgelt)
    • setTrains

      public void setTrains(String fn_tns, int mode)
      Set the name of the train set file and the record contents mode.
      Parameters:
      fn_tns - the name of the train set file
      mode - the record contents mode (TrainSet.ITEM_POINT, TrainSet.POINT_ITEM, TrainSet.ITEM_TRAIN or TrainSet.PURE_TRAIN)
      Since:
      2013.12.10 (Christian Borgelt)
    • setTrains

      public void setTrains(String fn_tns, String recseps, String fldseps, String blanks, String comment, int mode)
      Set the name of the train set file, the structure characters, and the record contents mode.
      Parameters:
      fn_tns - the name of the train set file
      recseps - the record separators
      fldseps - the field separators
      blanks - the blank characters
      comment - the comment characters
      mode - the record contents mode (TrainSet.ITEM_POINT, TrainSet.POINT_ITEM, TrainSet.ITEM_TRAIN or TrainSet.PURE_TRAIN)
      Since:
      2013.12.10 (Christian Borgelt)
    • setTrains

      public void setTrains(TrainSet trains)
      Set the train set to analyze.
      Parameters:
      trains - the train set to analyze
      Since:
      2013.12.10 (Christian Borgelt)
    • setSpectrum

      public void setSpectrum(String fn_psp)
      Set the name of the pattern spectrum file.
      Parameters:
      fn_psp - the name of the pattern spectrum file
      Since:
      2013.12.10 (Christian Borgelt)
    • setSpectrum

      public void setSpectrum(String fn_psp, String pspsep)
      Set the name of the pattern spectrum file.
      Parameters:
      fn_psp - the name of the pattern spectrum file
      pspsep - the field separators for the pattern spectrum
      Since:
      2013.12.10 (Christian Borgelt)
    • setSpectrum

      public void setSpectrum(table.Table spectrum)
      Set the pattern spectrum.
      Parameters:
      spectrum - the pattern spectrum as a 3 column table
      Since:
      2013.12.10 (Christian Borgelt)
    • setOutput

      public void setOutput(String fn_out)
      Set the pattern output file name.
      Parameters:
      fn_out - the pattern output file name
      Since:
      2013.12.10 (Christian Borgelt)
    • setOutput

      public void setOutput(String fn_out, String header, String itemsep, String outfmt)
      Set the pattern output file name and the format strings.
      Parameters:
      fn_out - the pattern output file name
      header - the record header (output before each pattern)
      itemsep - the item separator (output between patterns)
      outfmt - the support output format
      Since:
      2013.12.10 (Christian Borgelt)
    • setRange

      public void setRange(double beg, double end)
      Set the (allowed) range of points/spike times.
      Parameters:
      beg - the beginning of the point range
      end - the end of the point range
      Since:
      2013.12.10 (Christian Borgelt)
    • setSurrogate

      public void setSurrogate(int cnt, int surr, int rand, double sigma, double delta)
      Set the surrogate data parameters.
      Parameters:
      cnt - the number of surrogate data sets to generate
      surr - the surrgate data generation method (e.g. DITHER or PERMUTE)
      rand - the random number density function type (e.g. UNIFORM or NORMAL)
      sigma - the random number density function parameter
      delta - the block size for blocked permutations
      Since:
      2013.12.10 (Christian Borgelt)
    • setSurrogate

      public void setSurrogate(int cnt, int surr, int rand, double sigma, double delta, int seed)
      Set the surrogate data parameters.
      Parameters:
      cnt - the number of surrogate data sets to generate
      surr - the surrgate data generation method
      rand - the random number density function type
      sigma - the random number density function parameter
      delta - the block size for blocked permutations
      seed - the seed for the random number generator
      Since:
      2013.12.10 (Christian Borgelt)
    • setEstimate

      public void setEstimate(int equiv, double alpha, int smpls)
      Set the pattern spectrum estimation parameters.
      Parameters:
      equiv - the equivalent number of surrogate data sets
      alpha - the item probability dispersion factor
      smpls - the number of samples per item set size
      Since:
      2014.03.07 (Christian Borgelt)
    • setEstimate

      public void setEstimate(int equiv, double alpha, int smpls, int seed)
      Set the pattern spectrum estimation parameters.
      Parameters:
      equiv - the equivalent number of surrogate data sets
      alpha - the item probability dispersion factor
      smpls - the number of samples per item set size
      seed - the seed for the random number generator
      Since:
      2014.03.07 (Christian Borgelt)
    • setCoCoNAD

      public void setCoCoNAD(int target, int suborig, int subsurr, double width, int supp, int zmin, int zmax)
      Set the CoCoNAD parameters.
      Parameters:
      target - the target pattern type (ITEMSET, PERMUTATION, or SEQUENCE)
      suborig - the target pattern subtype for the original data (FREQUENT, SETS, CLOSED or MAXIMAL)
      subsurr - the target pattern subtype for the surrogate data (FREQUENT, SETS, CLOSED or MAXIMAL)
      width - the window width/maximum distance
      supp - the minimum support of an item set
      zmin - the minimal size of an item set
      zmax - the maximal size of an item set
      Since:
      2013.12.10 (Christian Borgelt)
    • setCoCoNAD

      public void setCoCoNAD(int target, int suborig, int subsurr, double width, int supp, int zmin, int zmax, int algo, int mode)
      Set the CoCoNAD parameters.
      Parameters:
      target - the target pattern type (ITEMSET, PERMUTATION, or SEQUENCE)
      suborig - the target pattern subtype for the original data (FREQUENT, SETS, CLOSED or MAXIMAL)
      subsurr - the target pattern subtype for the surrogate data (FREQUENT, SETS, CLOSED or MAXIMAL)
      width - the window width/maximum distance
      supp - the minimum support of an item set
      zmin - the minimal size of an item set
      zmax - the maximal size of an item set
      algo - the CoCoNAD algorithm variant to use (BASIC, FILTER or CMREPO)
      mode - the processign mode to use (NONE or flags NOPERFECT or NOSORT)
      Since:
      2013.12.10 (Christian Borgelt)
    • setReduction

      public void setReduction(int psr)
      Set the pattern set reduction method.
      Parameters:
      psr - the pattern set reduction method
      Since:
      2013.12.10 (Christian Borgelt)
    • setCPUs

      public void setCPUs(int cpus)
      Set the number of CPUs/threads to use.
      Parameters:
      cpus - the number of CPUs/threads to use (0: determine a suitable number automatically)
      Since:
      2013.12.10 (Christian Borgelt)
    • exec

      public void exec() throws IOException
      Execute pattern spectrum filtering and pattern set reduction.
      Specified by:
      exec in interface util.Executable
      Throws:
      IOException
      Since:
      2013.12.10 (Christian Borgelt)
    • abort

      public void abort()
      Abort the computations (set an abort flag).
      Specified by:
      abort in interface util.Executable
      Since:
      2013.12.10 (Christian Borgelt)
    • getResultMsg

      public String getResultMsg()
      Get the result message of the computations.
      Returns:
      the result message of the computations
      Since:
      2013.12.10 (Christian Borgelt)