classifiers/resting_tremor_classifier.py
def extract_tremor_classification_features(data_df, current_feature_df, data_channels, fs):
    '''
    Compute signal features applicable for tremor classification for a given 3 second window.
    :param data_df: Raw accelerometer data as Pandas DataFrame. Columns = ['ts', 'x', 'y', 'z']
    :param current_feature_df: Pandas DataFrame of current features to append new features to.
    :param data_channels: Data channels to run features on. Ex: ['x','y','z']
    :param fs: Sampling rate of raw accelerometer data (float)
    :return: Pandas DataFrame of computed features for given window of data.
    '''
    # Compute signal range
    feat_df_range = sf.signal_range(data_df, channels=data_channels)
    current_feature_df = current_feature_df.join(feat_df_range, how='outer')

    # Compute RMS
    feat_df_rms = sf.signal_rms(data_df, channels=data_channels)
    current_feature_df = current_feature_df.join(feat_df_rms, how='outer')

    # Compute Dominant Frequency
    frequncy_cutoff = 12.0
    feat_df_dom_freq = sf.dominant_frequency(data_df, fs, frequncy_cutoff, data_channels)
    current_feature_df = current_feature_df.join(feat_df_dom_freq, how='outer')

    # Compute Entropy
    feat_df_entropy = sf.signal_entropy(data_df, channels=data_channels)
    current_feature_df = current_feature_df.join(feat_df_entropy, how='outer')

    return current_feature_df

    Compute signal features applicable for tremor classification for a given 3 second window.
    :param data_df: Raw accelerometer data as Pandas DataFrame. Columns = ['ts', 'x', 'y', 'z']
    :param current_feature_df: Pandas DataFrame of current features to append new features to.
    :param data_channels: Data channels to run features on. Ex: ['x','y','z']
    :param fs: Sampling rate of raw accelerometer data (float)
    :return: Pandas DataFrame of computed features for given window of data.
    
Compute signal features applicable for tremor classification for a given 3 second window.
Compute signal features applicable for tremor classification for a given 3 second window .
def extract_tremor_classification_features(data_df, current_feature_df, data_channels, fs):
    feat_df_range = sf.signal_range(data_df, channels=data_channels)
    current_feature_df = current_feature_df.join(feat_df_range, how='outer')
    feat_df_rms = sf.signal_rms(data_df, channels=data_channels)
    current_feature_df = current_feature_df.join(feat_df_rms, how='outer')
    frequncy_cutoff = 12.0
    feat_df_dom_freq = sf.dominant_frequency(data_df, fs, frequncy_cutoff, data_channels)
    current_feature_df = current_feature_df.join(feat_df_dom_freq, how='outer')
    feat_df_entropy = sf.signal_entropy(data_df, channels=data_channels)
    current_feature_df = current_feature_df.join(feat_df_entropy, how='outer')
    return current_feature_df
def extract_tremor_classification_features ( data_df , current_feature_df , data_channels , fs ) : feat_df_range = sf . signal_range ( data_df , channels = data_channels ) current_feature_df = current_feature_df . join ( feat_df_range , how = 'outer' ) feat_df_rms = sf . signal_rms ( data_df , channels = data_channels ) current_feature_df = current_feature_df . join ( feat_df_rms , how = 'outer' ) frequncy_cutoff = 12.0 feat_df_dom_freq = sf . dominant_frequency ( data_df , fs , frequncy_cutoff , data_channels ) current_feature_df = current_feature_df . join ( feat_df_dom_freq , how = 'outer' ) feat_df_entropy = sf . signal_entropy ( data_df , channels = data_channels ) current_feature_df = current_feature_df . join ( feat_df_entropy , how = 'outer' ) return current_feature_df
Compute signal features applicable for tremor classification for a given 3 second window.
Compute signal features applicable for tremor classification for a given 3 second window .
'''
    Compute signal features applicable for tremor classification for a given 3 second window.
    :param data_df: Raw accelerometer data as Pandas DataFrame. Columns = ['ts', 'x', 'y', 'z']
    :param current_feature_df: Pandas DataFrame of current features to append new features to.
    :param data_channels: Data channels to run features on. Ex: ['x','y','z']
    :param fs: Sampling rate of raw accelerometer data (float)
    :return: Pandas DataFrame of computed features for given window of data.
    ''' # Compute signal range # Compute RMS # Compute Dominant Frequency # Compute Entropy
Pandas DataFrame of computed features for given window of data.
Pandas DataFrame of computed features for given window of data .
data_df
Raw accelerometer data as Pandas DataFrame.
Raw accelerometer data as Pandas DataFrame .
current_feature_df
Pandas DataFrame of current features to append new features to.
Pandas DataFrame of current features to append new features to .
data_channels
Data channels to run features on.
Data channels to run features on .
fs
Sampling rate of raw accelerometer data (float)
Sampling rate of raw accelerometer data ( float )