Package coconad
Class JNICoCo
java.lang.Object
coconad.JNICoCo
Class for Java interface to CoCoNAD implementation in C
- Since:
- 2013.11.21
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
target pattern subtype: all frequent patternsstatic final int
target pattern subtype flag: closed/maximal w.r.t.static final int
algorithm variant: automatic choice based on target typestatic final int
algorithm variant: basic version (low memory consumption, slow)static final int
surrogate method: dithered blocked permutationstatic final int
target pattern subtype: all closed (frequent) patternsstatic final int
algorithm variant: refined version (closed/maximal repository)static final int
pattern set reduction: excess coincidences (zb,cb-ca)static final int
pattern set reduction: excess coincidences (zb,cb-ca+1)static final String
pattern spectrum report format: columnsstatic final int
pattern set reduction: covered points/spikes za*ca : zb*cbstatic final int
pattern set reduction: covered points/spikes (za-1)*ca : (zb-1)*cbstatic final int
surrogate method: point/spike dithering/displacementstatic final int
algorithm variant: refined version (spike and train filtering)static final int
target pattern subtype: all frequent patternsstatic final int
random number density function: Gaussian (identical toNORMAL
static final int
surrogate method: identity (keep original data)static final int
pattern set reduction: excess items/neurons (za-zb+2,ca)static final int
target pattern type: item setsstatic final int
pattern set reduction: none (keep all patterns after filtering)static final int
surrogate method: sampling from kernel estimatestatic final int
pattern set reduction: combined lenient (z, break rejection tie)static final int
pattern set reduction: combined lenient (z-1, break rejection tie)static final int
target pattern subtype: all maximal (frequent) patternsstatic final int
processing mode: no special flagsstatic final int
processing mode: do not use perfect extension pruningstatic final int
random number density function: normal (identical toGAUSS
static final int
processing mode: do not reorder trains by their lengthstatic final String
pattern spectrum report format: objectsstatic final int
target pattern type: partial permutations (without repetitions)static final int
surrogate method: dithered point/spike permutationstatic final int
surrogate method: point/spike time rendomizationstatic final int
random number density function: rectangular (identical toUNIFORM
static final int
algorithm variant: refined version (closed/maximal repository)static final int
processing mode: repository is a chain of prefix treesstatic final int
processing mode: repository is a list/an arraystatic final int
processing mode: repository is a single prefix treesstatic final int
target pattern type: sequences (with and without repetitions)static final int
surrogate method: train shifting/ditheringstatic final int
pattern set reduction: combined strict (z, force decision)static final int
pattern set reduction: combined strict (z-1, force decision)static final int
target pattern subtype maskstatic final int
random number density function: triangularstatic final int
target pattern type maskstatic final int
random number density function: uniform (identical toRECT
static final String
the version string -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
abort
(int state) Set the abort state (abort computations or clear abort state).static Object[]
coconad
(double[][] trains, int target, double width, int supp, int zmin, int zmax, String report, int algo, int mode, int[] border) Java interface to CoCoNAD implementation in C.static fim.PatternSet
coconad
(TrainSet trains, int target, double width, int supp, int zmin, int zmax, int algo, int mode, int[] border) Java interface to CoCoNAD implementation in C (wrapper with Java objects).static Object[]
estpsp
(double[][] trains, int target, double width, int supp, int zmin, int zmax, String report, int equiv, double alpha, int smpls, int seed) Estimate a pattern spectrum from data characteristics.static fim.PatSpecElem[]
estpsp
(TrainSet trains, int target, double width, int supp, int zmin, int zmax, int equiv, double alpha, int smpls, int seed) Estimate a pattern spectrum from data characteristics (wrapper with Java objects).static Object[]
genpsp
(double[][] trains, int target, double width, int supp, int zmin, int zmax, String report, int algo, int mode, int cnt, double beg, double end, int surr, int rand, double sigma, double delta, int seed, int cpus, int[] ctrl) Pattern spectrum generation with surrogate data sets.static fim.PatSpecElem[]
genpsp
(TrainSet trains, int target, double width, int supp, int zmin, int zmax, int algo, int mode, int cnt, double beg, double end, int surr, int rand, double sigma, double delta, int seed, int cpus, int[] ctrl) Pattern spectrum generation with surrogate data sets (wrapper with java objects).static void
Main program for testing.static fim.PatternSet
patred
(fim.PatternSet pats, int method, int[] border, boolean addis) Reduce a pattern set.static Object[]
Reduce a pattern set.static int[]
psp2bdr
(fim.PatSpecElem[] psp) Extract decision border from pattern spectrum.static int[]
Extract decision border from pattern spectrum.
-
Field Details
-
VERSION
the version string- See Also:
-
SUBMASK
public static final int SUBMASKtarget pattern subtype mask- See Also:
-
TYPEMASK
public static final int TYPEMASKtarget pattern type mask- See Also:
-
ITEMSET
public static final int ITEMSETtarget pattern type: item sets- See Also:
-
PERMUTATION
public static final int PERMUTATIONtarget pattern type: partial permutations (without repetitions)- See Also:
-
SEQUENCE
public static final int SEQUENCEtarget pattern type: sequences (with and without repetitions)- See Also:
-
FREQUENT
public static final int FREQUENTtarget pattern subtype: all frequent patterns- See Also:
-
ALL
public static final int ALLtarget pattern subtype: all frequent patterns- See Also:
-
CLOSED
public static final int CLOSEDtarget pattern subtype: all closed (frequent) patterns- See Also:
-
MAXIMAL
public static final int MAXIMALtarget pattern subtype: all maximal (frequent) patterns- See Also:
-
APPEND
public static final int APPENDtarget pattern subtype flag: closed/maximal w.r.t. appending- See Also:
-
AUTO
public static final int AUTOalgorithm variant: automatic choice based on target type- See Also:
-
BASIC
public static final int BASICalgorithm variant: basic version (low memory consumption, slow)- See Also:
-
FILTER
public static final int FILTERalgorithm variant: refined version (spike and train filtering)- See Also:
-
CMREPO
public static final int CMREPOalgorithm variant: refined version (closed/maximal repository)- See Also:
-
REPO
public static final int REPOalgorithm variant: refined version (closed/maximal repository)- See Also:
-
NONE
public static final int NONEprocessing mode: no special flags- See Also:
-
NOPERFECT
public static final int NOPERFECTprocessing mode: do not use perfect extension pruning- See Also:
-
NOSORT
public static final int NOSORTprocessing mode: do not reorder trains by their length- See Also:
-
REPOCHAIN
public static final int REPOCHAINprocessing mode: repository is a chain of prefix trees- See Also:
-
REPOTREE
public static final int REPOTREEprocessing mode: repository is a single prefix trees- See Also:
-
REPOLIST
public static final int REPOLISTprocessing mode: repository is a list/an array- See Also:
-
IDENTITY
public static final int IDENTITYsurrogate method: identity (keep original data)- See Also:
-
RANDOM
public static final int RANDOMsurrogate method: point/spike time rendomization- See Also:
-
DITHER
public static final int DITHERsurrogate method: point/spike dithering/displacement- See Also:
-
SHIFT
public static final int SHIFTsurrogate method: train shifting/dithering- See Also:
-
KERNEST
public static final int KERNESTsurrogate method: sampling from kernel estimate- See Also:
-
PERMUTE
public static final int PERMUTEsurrogate method: dithered point/spike permutation- See Also:
-
BLOCK
public static final int BLOCKsurrogate method: dithered blocked permutation- See Also:
-
UNIFORM
public static final int UNIFORMrandom number density function: uniform (identical toRECT
- See Also:
-
RECT
public static final int RECTrandom number density function: rectangular (identical toUNIFORM
- See Also:
-
TRIANG
public static final int TRIANGrandom number density function: triangular- See Also:
-
GAUSS
public static final int GAUSSrandom number density function: Gaussian (identical toNORMAL
- See Also:
-
NORMAL
public static final int NORMALrandom number density function: normal (identical toGAUSS
- See Also:
-
OBJECTS
pattern spectrum report format: objects- See Also:
-
COLUMNS
pattern spectrum report format: columns- See Also:
-
KEEP
public static final int KEEPpattern set reduction: none (keep all patterns after filtering)- See Also:
-
COINS0
public static final int COINS0pattern set reduction: excess coincidences (zb,cb-ca)- See Also:
-
COINS1
public static final int COINS1pattern set reduction: excess coincidences (zb,cb-ca+1)- See Also:
-
ITEMS2
public static final int ITEMS2pattern set reduction: excess items/neurons (za-zb+2,ca)- See Also:
-
COVER0
public static final int COVER0pattern set reduction: covered points/spikes za*ca : zb*cb- See Also:
-
COVER1
public static final int COVER1pattern set reduction: covered points/spikes (za-1)*ca : (zb-1)*cb- See Also:
-
LENIENT0
public static final int LENIENT0pattern set reduction: combined lenient (z, break rejection tie)- See Also:
-
LENIENT1
public static final int LENIENT1pattern set reduction: combined lenient (z-1, break rejection tie)- See Also:
-
STRICT0
public static final int STRICT0pattern set reduction: combined strict (z, force decision)- See Also:
-
STRICT1
public static final int STRICT1pattern set reduction: combined strict (z-1, force decision)- See Also:
-
-
Constructor Details
-
JNICoCo
public JNICoCo()Constructor.- Since:
- 2023.07.30 (Christian Borgelt)
-
-
Method Details
-
coconad
public static Object[] coconad(double[][] trains, int target, double width, int supp, int zmin, int zmax, String report, int algo, int mode, int[] border) Java interface to CoCoNAD implementation in C.- Parameters:
trains
- array of (spike) trains to analyze, each of which is an array of floating point numberstarget
- type of the patterns to find (ITEMSET
,PERMUTATION
PERMUT
,SEQUENCE
orSEQ
as the target pattern type andFREQUENT
,ALL
,CLOSED
orMAXIMAL
as the target pattern subtype, with possibly added flagAPPEND
)width
- width of the time window/maximum time spansupp
- minimum support of an item setzmin
- minimum number of items per item setzmax
- maximum number of items per item setreport
- values to report with an item set
"a": item set support (number of coincidences)
"|": pattern spectrum in column format
"-": pattern spectrum withPatSpecElem
"=": pattern spectrum withPatSpecElem
algo
- algorithm variant to use (BASIC
,FILTER
orCMREPO
)mode
- processing mode to use (NONE
or flagsNOPERFECT
orNOSORT
)border
- array of support thresholds per item set size- Returns:
- if report = "a": an array with two elements, the first
of which is an array that contains the item sets as
integer arrays, while the second is an integer array
containing the support values (each corresponding to the
item set at the same array index in the first array).
if report = "|": an array with three elements; the first array contains the item set sizes as integers, the second array contains the support values as integers (that is, corresponding elements of the first and the second array form a pattern signature), and the third array contains the frequency (number of occurrences) of the size/support pair (at the same array index in the first two arrays) as a double precision floating point value.
if report = '=' or '-': an array with objects of typePatSpecElem
, each of which specifies a pattern signature together with its occurrence frequency. - Since:
- 2013.11.21 (Christian Borgelt)
-
coconad
public static fim.PatternSet coconad(TrainSet trains, int target, double width, int supp, int zmin, int zmax, int algo, int mode, int[] border) Java interface to CoCoNAD implementation in C (wrapper with Java objects).- Parameters:
trains
- (spike) trains to analyzetarget
- type of the patterns to find (ITEMSET
,PERMUTATION
PERMUT
,SEQUENCE
orSEQ
as the target pattern type andFREQUENT
,ALL
,CLOSED
orMAXIMAL
as the target pattern subtype, with possibly added flagAPPEND
)width
- width of the time window/maximum time spansupp
- minimum support of an item setzmin
- minimum number of items per item setzmax
- maximum number of items per item setalgo
- algorithm variant to use (BASIC
,FILTER
orCMREPO
)mode
- processing mode to use (NONE
or flagsNOPERFECT
orNOSORT
)border
- array of support thresholds per item set size- Returns:
- a set of (frequent) patterns
- Since:
- 2014.10.23 (Christian Borgelt)
-
genpsp
public static Object[] genpsp(double[][] trains, int target, double width, int supp, int zmin, int zmax, String report, int algo, int mode, int cnt, double beg, double end, int surr, int rand, double sigma, double delta, int seed, int cpus, int[] ctrl) Pattern spectrum generation with surrogate data sets.- Parameters:
trains
- array of (spike) trains to analyze, each of which is an array of floating point numberstarget
- type of the patterns to find (ITEMSET
,PERMUTATION
PERMUT
,SEQUENCE
orSEQ
as the target pattern type andFREQUENT
,ALL
,CLOSED
orMAXIMAL
as the target pattern subtype, with possibly added flagAPPEND
)width
- width of the time window/maximum time spansupp
- minimum support of an item setzmin
- minimum number of items per item setzmax
- maximum number of items per item setreport
- format in which to report the pattern spectrum
"|": pattern spectrum in column format
"-": pattern spectrum withPatSpecElem
"=": pattern spectrum withPatSpecElem
algo
- algorithm variant to use (BASIC
,FILTER
orCMREPO
)mode
- processing mode to use (NONE
or flagsNOPERFECT
orNOSORT
)cnt
- number of surrogate data sets to generatebeg
- beginning of allowed span of pointsend
- end of allowed span of pointssurr
- surrogate data generation method (IDENTITY
,RANDOM
,DITHER
,SHIFT
,KERNEST
orPERMUTE
)rand
- random number density function (for point/spike displacements) (UNIFORM
,RECT
,TRIANG
,GAUSS
orNORMAL
)sigma
- standard deviation or half the base width of the rectangular/triangular density functiondelta
- block size for blocked permutationsseed
- seed value for random number generatorcpus
- number of cpus/threads to usectrl
- control array (progress indicator, stop flag)- Returns:
- if report = "|": an array with three elements; the first
array contains the item set sizes as integers, the second
array contains the support values as integers (that is,
corresponding elements of the first and the second array
form a pattern signature), and the third array contains
the frequency (number of occurrences) of the size/support
pair (at the same array index in the first two arrays)
as a double precision floating point value.
if report = '=' or '-': an array with objects of typePatSpecElem
, each of which specifies a pattern signature together with its occurrence frequency. - Since:
- 2013.12.04 (Christian Borgelt)
-
genpsp
public static fim.PatSpecElem[] genpsp(TrainSet trains, int target, double width, int supp, int zmin, int zmax, int algo, int mode, int cnt, double beg, double end, int surr, int rand, double sigma, double delta, int seed, int cpus, int[] ctrl) Pattern spectrum generation with surrogate data sets (wrapper with java objects).- Parameters:
trains
- (spike) trains to analyzetarget
- type of the patterns to find (ITEMSET
,PERMUTATION
PERMUT
,SEQUENCE
orSEQ
as the target pattern type andFREQUENT
,ALL
,CLOSED
orMAXIMAL
as the target pattern subtype, with possibly added flagAPPEND
)width
- width of the time window/maximum time spansupp
- minimum support of an item setzmin
- minimum number of items per item setzmax
- maximum number of items per item setalgo
- algorithm variant to use (BASIC
,FILTER
orCMREPO
)mode
- processing mode to use (NONE
or flagsNOPERFECT
orNOSORT
)cnt
- number of surrogate data sets to generatebeg
- beginning of allowed span of pointsend
- end of allowed span of pointssurr
- surrogate data generation method (IDENTITY
,RANDOM
,DITHER
,SHIFT
,KERNEST
orPERMUTE
)rand
- random number density function (for point/spike displacements) (UNIFORM
,RECT
,TRIANG
,GAUSS
orNORMAL
)sigma
- standard deviation or half the base width of the rectangular/triangular density functiondelta
- block size for blocked permutationsseed
- seed value for random number generatorcpus
- number of cpus/threads to usectrl
- control array (progress indicator, stop flag)- Returns:
- an array with objects of type
PatSpecElem
, each of which specifies a pattern signature together with its occurrence frequency - Since:
- 2014.10.23 (Christian Borgelt)
-
estpsp
public static Object[] estpsp(double[][] trains, int target, double width, int supp, int zmin, int zmax, String report, int equiv, double alpha, int smpls, int seed) Estimate a pattern spectrum from data characteristics.- Parameters:
trains
- array of (spike) trains to analyze, each of which is an array of floating point numberstarget
- type of the patterns to find (ITEMSET
,PERMUTATION
PERMUT
,SEQUENCE
orSEQ
as the target pattern type andFREQUENT
,ALL
,CLOSED
orMAXIMAL
as the target pattern subtype)width
- width of the time window/maximum time spansupp
- minimum support of an item setzmin
- minimum number of items per item setzmax
- maximum number of items per item setreport
- format in which to report the pattern spectrum
"|": pattern spectrum in column format
"-": pattern spectrum withPatSpecElem
"=": pattern spectrum withPatSpecElem
equiv
- equivalent number of surrogate data setsalpha
- probability dispersion factorsmpls
- number of samples per item set sizeseed
- seed value for random number generator- Returns:
- if report = "|": an array with three elements; the first
array contains the item set sizes as integers, the second
array contains the support values as integers (that is,
corresponding elements of the first and the second array
form a pattern signature), and the third array contains
the frequency (number of occurrences) of the size/support
pair (at the same array index in the first two arrays)
as a double precision floating point value.
if report = '=' or '-': an array with objects of typePatSpecElem
, each of which specifies a pattern signature together with its occurrence frequency. - Since:
- 2014.03.06 (Christian Borgelt)
-
estpsp
public static fim.PatSpecElem[] estpsp(TrainSet trains, int target, double width, int supp, int zmin, int zmax, int equiv, double alpha, int smpls, int seed) Estimate a pattern spectrum from data characteristics (wrapper with Java objects).- Parameters:
trains
- (spike) trains to analyzetarget
- type of the patterns to find (ITEMSET
,PERMUTATION
PERMUT
,SEQUENCE
orSEQ
as the target pattern type andFREQUENT
,ALL
,CLOSED
orMAXIMAL
as the target pattern subtype)width
- width of the time window/maximum time spansupp
- minimum support of an item setzmin
- minimum number of items per item setzmax
- maximum number of items per item setequiv
- equivalent number of surrogate data setsalpha
- probability dispersion factorsmpls
- number of samples per item set sizeseed
- seed value for random number generator- Returns:
- an array with objects of type
PatSpecElem
, each of which specifies a pattern signature together with its occurrence frequency - Since:
- 2014.10.23 (Christian Borgelt)
-
psp2bdr
Extract decision border from pattern spectrum.- Parameters:
psp
- the pattern spectrum to process- Returns:
- an array of minimum support values per pattern size; to be indexed by the pattern size
- Since:
- 2015.08.13 (Christian Borgelt)
-
psp2bdr
public static int[] psp2bdr(fim.PatSpecElem[] psp) Extract decision border from pattern spectrum.- Parameters:
psp
- the pattern spectrum to process- Returns:
- an array of minimum support values per pattern size; to be indexed by the pattern size
- Since:
- 2015.08.13 (Christian Borgelt)
-
patred
Reduce a pattern set.- Parameters:
pats
- the pattern set to reduce as an array with two elements, the first of which is an array that contains the item sets as integer arrays, while the second is an integer array containing the support values (each corresponding to the item set the same array index in the first array)method
- the pattern set reduction method (one ofKEEP
,COINS0
,COINS1
,ITEMS2
,COVER0
,COVER1
,LENIENT0
,LENIENT1
,STRICT0
,STRICT1
)border
- the decision border for rejecting patternsaddis
- whether to add pattern intersections- Returns:
- the reduced pattern set as an array with two elements, the first of which is an array that contains the item sets as integer arrays, while the second is an integer array containing the support values (each corresponding to the item set the same array index in the first array)
- Since:
- 2015.08.13 (Christian Borgelt)
-
patred
public static fim.PatternSet patred(fim.PatternSet pats, int method, int[] border, boolean addis) Reduce a pattern set.- Parameters:
pats
- the pattern set to reducemethod
- the pattern set reduction method (one ofKEEP
,COINS0
,COINS1
,ITEMS2
,COVER0
,COVER1
,LENIENT0
,LENIENT1
,STRICT0
,STRICT1
)border
- the decision border for rejecting patternsaddis
- whether to add pattern intersections- Returns:
- the reduced pattern set
- Since:
- 2015.08.13 (Christian Borgelt)
-
abort
public static void abort(int state) Set the abort state (abort computations or clear abort state).- Parameters:
state
- abort state to set (0: clear; != 0: signal abort)- Since:
- 2015.03.05 (Christian Borgelt)
-
main
Main program for testing.- Parameters:
args
- the command line arguments- Since:
- 2013.11.21 (Christian Borgelt)
-