myo_helper/myo_helper.py
def normalise_by_rep(emg, rep, train_reps):
    """Preprocess train+test data to mean 0, std 1 based on training data only."""
    # Locate valid window end indices (window must be window_len long and window_inc away from last)
    train_idx = np.where(np.in1d(rep, train_reps))

    scaler = StandardScaler(with_mean=True,
                            with_std=True,
                            copy=False).fit(emg[train_idx])

    return scaler.transform(emg), scaler
Preprocess train+test data to mean 0, std 1 based on training data only.
Preprocess train+test data to mean 0, std 1 based on training data only.
Preprocess train + test data to mean 0 std 1 based on training data only .
def normalise_by_rep(emg, rep, train_reps):
    train_idx = np.where(np.in1d(rep, train_reps))
    scaler = StandardScaler(with_mean=True,
                            with_std=True,
                            copy=False).fit(emg[train_idx])
    return scaler.transform(emg), scaler
def normalise_by_rep ( emg , rep , train_reps ) : train_idx = np . where ( np . in1d ( rep , train_reps ) ) scaler = StandardScaler ( with_mean = True , with_std = True , copy = False ) . fit ( emg [ train_idx ] ) return scaler . transform ( emg ) , scaler
Preprocess train+test data to mean 0, std 1 based on training data only.
Preprocess train + test data to mean 0 std 1 based on training data only .
"""Preprocess train+test data to mean 0, std 1 based on training data only.""" # Locate valid window end indices (window must be window_len long and window_inc away from last)

emg
rep
train_reps