Demo entry 6742380

PPD

   

Submitted by anonymous on May 17, 2018 at 22:05
Language: Python. Code size: 1.9 kB.

# Adapted from: https://github.com/sussexwearlab/DeepConvLSTM
__author__ = 'fjordonez, gchevalier'

from signal_filtering import filter_opportunity_datasets_accelerometers

import os
import sys
import zipfile
import argparse
import numpy as np
# import cPickle as cp

from io import BytesIO
from pandas import Series

# Hardcoded number of sensor channels employed in the OPPORTUNITY challenge
NB_SENSOR_CHANNELS = 113
NB_SENSOR_CHANNELS_WITH_FILTERING = 149 # =77 gyros +36*2 accelerometer channels

# Hardcoded names of the files defining the OPPORTUNITY challenge data. As named in the original data.
OPPORTUNITY_DATA_FILES_TRAIN = [
    'OpportunityUCIDataset/dataset/S1-Drill.dat',
    'OpportunityUCIDataset/dataset/S1-ADL1.dat',
    'OpportunityUCIDataset/dataset/S1-ADL2.dat',
    'OpportunityUCIDataset/dataset/S1-ADL3.dat',
    'OpportunityUCIDataset/dataset/S1-ADL4.dat',
    'OpportunityUCIDataset/dataset/S1-ADL5.dat',
    'OpportunityUCIDataset/dataset/S2-Drill.dat',
    'OpportunityUCIDataset/dataset/S2-ADL1.dat',
    'OpportunityUCIDataset/dataset/S2-ADL2.dat',
    'OpportunityUCIDataset/dataset/S2-ADL3.dat',
    'OpportunityUCIDataset/dataset/S3-Drill.dat',
    'OpportunityUCIDataset/dataset/S3-ADL1.dat',
    'OpportunityUCIDataset/dataset/S3-ADL2.dat',
    'OpportunityUCIDataset/dataset/S3-ADL3.dat'
]

OPPORTUNITY_DATA_FILES_TEST = [
    'OpportunityUCIDataset/dataset/S2-ADL4.dat',
    'OpportunityUCIDataset/dataset/S2-ADL5.dat',
    'OpportunityUCIDataset/dataset/S3-ADL4.dat',
    'OpportunityUCIDataset/dataset/S3-ADL5.dat'
]

def select_columns_opp(data):
    """Selection of the 113 columns employed in the OPPORTUNITY challenge

    :param data: numpy integer matrix
        Sensor data (all features)
    :return: tuple((numpy integer 2D matrix, numpy integer 1D matrix))
        (Selection of features (N, f), feature_is_accelerometer (f,) one-hot)
    """

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).