def generate_class_label_presence(data, state_variable='target'):
    "\n    generates class label only for presence on a copy of data using only the columns\n    Removes: Pause and merges 'Step' and 'Stand' to same class\n    "
    r_data = data.copy()
    r_data = r_data[(~ r_data['target'].str.contains('Pause'))]
    r_data.loc[(r_data['target'].str.contains('Step'), 'target')] = 'Present'
    r_data.loc[(r_data['target'].str.contains('Stand'), 'target')] = 'Present'
    r_data.loc[(r_data['target'].str.contains('Walk'), 'target')] = 'Present'
    r_data = r_data[(~ r_data['target'].str.contains('Enter'))]
    r_data = r_data[(~ r_data['target'].str.contains('Leave'))]
    r_data.loc[((~ r_data['target'].str.contains('Present')), 'target')] = 'Not Present'
    return r_data.reset_index()
generates class label only for presence on a copy of data using only the columns
Removes: Pause and merges 'Step' and 'Stand' to same class
def generate_class_label_presence(data, state_variable='target'):
    "\n    generates class label only for presence on a copy of data using only the columns\n    Removes: Pause and merges 'Step' and 'Stand' to same class\n    "
    r_data = data.copy()
    r_data = r_data[(~ r_data['target'].str.contains('Pause'))]
    r_data.loc[(r_data['target'].str.contains('Step'), 'target')] = 'Present'
    r_data.loc[(r_data['target'].str.contains('Stand'), 'target')] = 'Present'
    r_data.loc[(r_data['target'].str.contains('Walk'), 'target')] = 'Present'
    r_data = r_data[(~ r_data['target'].str.contains('Enter'))]
    r_data = r_data[(~ r_data['target'].str.contains('Leave'))]
    r_data.loc[((~ r_data['target'].str.contains('Present')), 'target')] = 'Not Present'
    return r_data.reset_index()