Skip to content

Instantly share code, notes, and snippets.

View hkraemer's full-sized avatar

Kai Hauke Krämer hkraemer

View GitHub Profile
function [a_out, b_out]=dl_kelo(varargin)
% DL_KELO Mean of the diagonal line lengths and their distribution -
% Correction for border lines: KEep LOngest diagonal line (kelo)
% A=dl_kelo(X) computes the mean of the length of the diagonal
% line structures in a recurrence plot X. In this correction, just the
% longest border line (in each triangle) of the RP is counted. All other
% border lines are discarded.
%
% A=dl_kelo(X,'semi') computes the mean of the length of the diagonal
% line structures in a recurrence plot X using the mentionded correction.
function [X_new,dl_new] = rp_diagonal(varargin)
% RP_DIAGONAL RP with corrected lines ...
%
% [RP_new, dl_new] = rp_diagonal(RP)
% computes a new recurrence plot 'RP_new' by altering diagonal line structures
% in the input recurrence plot 'RP': Slubs, but also block structures,
% are deleted in favour of the longest diagonal lines (skeletonization).
% Whenever a diagonal line (starting with the longest lines contained in
% the diagonal line length histogram) encounters an adjacent diagonal
% line, this adjacent line and - recursively - all its consecutive
@hkraemer
hkraemer / exercise 2 bei JP
Last active February 12, 2018 10:14
Versuch JP zu verstehen...
### exercise 4 2te teil
language, text = hamlets.iloc[0]
counted_text = count_words_fast(text)
data = pd.DataFrame({
"word": list(counted_text.keys()),
"count": list(counted_text.values())
})