Welcome to sciquence’s documentation!¶
Intro¶
Sciquence is a python module created especially to work with time series and other types of sequences. It mimics scikit-learn API, but introduces its own extensions as well.
Installation¶
To install current bleeding-edge sciquence
version, simply use command:
sudo pip install git+https://github.com/krzjoa/sciquence.git
sciquence API¶
sciquence.sequences¶
Cutting¶
seq (array) |
Cut input array into sequences consisting of the same elements |
nseq (array) |
Returns sequences consisting of zeros |
pseq (array) |
Returns sequences consisting of ones |
specseq (array, element) |
Return sequences consisting of specific tag |
seqi (array) |
Get list of sequences and corresponding list of indices |
nseqi (array) |
Get list of negative sequences indices (consisting of zeroes) |
pseqi (array) |
Get list of positive sequences indices (consisting of ones) |
specseqi (array, elem) |
Get list of sequences indices, consisting of specific element |
chunk (array, chunk_size) |
Split numpy array into chunks of equal length. |
Comparing¶
lseq_equal (lseqa, lseqb) |
Compare two lists of ndarrays |
shapes_equal (*arrays) |
Check if all the arrays have the same shape. |
size_equal (*arrays, **kwargs) |
Check if all the arrays have the same length along the particular axis. |
Sampling¶
random_slice (array_len, slice_length) |
Choose a random slice of given length |
Sorting¶
parallel_sort (*arrays, **kwargs) |
Parallel sort. |
Searching¶
mslc |
Given a length n real sequence, finds the consecutive subsequence of length at most U with the maximum sum in O(n) time. |
longest_segment |
Find the longest subsequence which scores above a given threshold in O(n) |
max_avg_seq |
Given a length n real sequence, finding the consecutive subsequence of length at least L with the maximum average can be done in O(n log L) time. |
sciquence.similarities¶
Similarities¶
dtw (A, B, metric) |
Measure similarities between two sequences. |
segmental_dtw |
Find similarities between two sequences. |
sciquence.postprocessing¶
Binarization¶
ClasswiseBinarizer (thresholds) |
Performing binarization classwise. |
binarize_classwise (X, thresholds) |
Binarization performed classwise. |