Example #1
0
def main(useExisting=True, path="..\..\Runs\\", features=None):
    if path is None:
        path = "..\..\Runs\\"
    path = checkPath(path)

    if features is not None:
        features = literal_eval(features)
        if type(features) == list:
            features = featuresToRequiredDict(features)

    data = getData(path, features, useExisting)
    return data
Example #2
0
    data = updateFeatures(data, path, requiredFeatures)
    data = cleanData(data)
    storeData(data, name)
    storePickle(requiredFeatures, name)
    return data


def getData(path, requiredFeatures, useExisting):
    if requiredFeatures is None:
        requiredFeatures = fa.getAllFeatures()
    if useExisting:
        try:
            return getDataExisting(path, requiredFeatures)
        except:
            return getDataNotExisting(path, requiredFeatures)
    else:
        return getDataNotExisting(path, requiredFeatures)


if __name__ == '__main__':
    from features.featuresToRequiredDict import featuresToRequiredDict
    path = "..\..\\verySmalldataSet\\"
    f = ['hip.Ax.min', 'hip.Vx.av', 'ankle.simple_sg_ncor.maxDist',
         'ankle.cwt_butter_cor.maxDist', 'head.fout.ief']
#     f = ['ankle.Ax.min', 'ankle.Vx.av','hip.simple_nosmooth.maxDist',
#         'hip.cwt_butter_cor.maxDist', 'head.fout.ief']
    requiredFeatures = featuresToRequiredDict(f)
    print(requiredFeatures)
    data = getData(path, requiredFeatures, False)
    print (data)
Example #3
0
        v3[bodypart] = dict()
        for cat in v1[bodypart].keys():
            v3[bodypart][cat] = {
                                'cols': v1[bodypart][cat]['cols'],
                                'features': v2[bodypart][cat]['features']
                               }
    return v3


if __name__ == '__main__':
    from features.featuresToRequiredDict import featuresToRequiredDict

    l1 = {'a': ['a', 'b', 'c', 'd']}
    l2 = {'a': ['c', 'd', 'e', 'f']}

    print(union(l1, l2))
    print(union([1, 2, 3], [3, 4, 5]))

    features1 = ['hip.Ax.min', 'ankle.AyAz.fcovar'
                  'hip.Vx.av', 'ankle.simple_nosmooth.maxDist',
                  'hip.cwt_butter_ncor.avPeak', 'ankle.cwt_butter_cor.maxDist',
                  'head.fout.ief']
    dict1 = featuresToRequiredDict(features1)
    features2 = []
    dict2 = featuresToRequiredDict(features2)

    print(dict1)
    print(dict2)
    ex1 = colsFirstFeaturesSecond(dict1, dict2)
    print(ex1)