<jupyter_start><jupyter_text>SlidingWindowFeature (`pyannote.core.feature.SlidingWindowFeature`)<jupyter_code>from pyannote.core import SlidingWindowFeature, SlidingWindow<jupyter_output><empty_output><jupyter_text>**SlidingWindowFeature** are used to manage feature vectors extracted on a sliding window (e.g. MFCC in audio processing).<jupyter_code># one 4-dimensional feature vector extracted every 100ms from a 200ms window
frame = SlidingWindow(start=0.0, step=0.100, duration=0.200)

# random for illustration purposes
data = np.random.randn(100, 4)

features = SlidingWindowFeature(data, frame)<jupyter_output><empty_output><jupyter_text>Cropping You may use `crop` to extract a temporal subset:<jupyter_code>help(features.crop)
from pyannote.core import Segment
features.crop(Segment(2, 3))<jupyter_output><empty_output><jupyter_text>Need help? You can always try the following...  Who knows? It might give you the information you are looking for!<jupyter_code>help(SlidingWindowFeature)<jupyter_output>Help on class SlidingWindowFeature in module pyannote.core.feature:

class SlidingWindowFeature(__builtin__.object)
 |  Periodic feature vectors
 |  
 |  Parameters
 |  ----------
 |  data : (nSamples, nFeatures) numpy array
 |  
 |  sliding_window : SlidingWindow
 |  
 |  Methods defined here:
 |  
 |  __getitem__(self, i)
 |      Get ith feature vector
 |  
 |  __init__(self, data, sliding_window)
 |  
 |  crop(self, focus, mode=u'loose', fixed=None)
 |      Extract frames as numpy array
 |      
 |      Parameters
 |      ----------
 |      focus : Segment or Timeline
 |      mode : {'loose', 'strict', 'center', 'fixed'}, optional
 |          In 'strict' mode, only frames fully included in focus coverage are
 |          returned. In 'loose' mode, any intersecting frames are returned. In
 |          'center' mode, first and last frames are chosen to be the positions
 |          whose centers are the closest to the focus start and end times.
 |          Defaults to 'loose'.
 |      fi[...]
{'fraction_non_alphanumeric': 0.10267857142857142, 'fraction_numerical': 0.011408730158730158, 'mean_word_length': 3.9557739557739557, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '591136', 'license': 'MIT', 'n_tokens_mistral': 630, 'n_tokens_neox': 607, 'n_words': 181, 'path': 'notebook/pyannote.core.feature.ipynb', 'repo_name': 'pkorshunov/pyannote-core', 'size': '2016'}