コード例 #1
0
ファイル: testing.py プロジェクト: aliince77/randomForest-1
def generateTwoTestAngleData():
    '''
    This creates a list of data samples to be tested.
    Theses samples are from participants 2 and 3 and
    the calculated angles are used as features.
    '''
    testSamples = []
    index = 0

    for filename in sub2:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the file calculate the 
        # angles inbetween joints and use the resulting 
        # array as the feature vector. Add that to the list.
        for line in fIn:
            features = generateAngles(line)
            testSamples.append(sample(features, labels[index]))
        fIn.close()
        index += 1

    index = 0
    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the file calculate the 
        # angles inbetween joints and use the resulting 
        # array as the feature vector. Add that to the list.
        for line in fIn:
            features = generateAngles(line)
            testSamples.append(sample(features, labels[index]))
        fIn.close()
        index += 1

    return testSamples
コード例 #2
0
ファイル: testing.py プロジェクト: marine0131/audio_process
def generateTwoTestAngleData():
    '''
    This creates a list of data samples to be tested.
    Theses samples are from participants 2 and 3 and
    the calculated angles are used as features.
    '''
    testSamples = []
    index = 0

    for filename in sub2:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the file calculate the
        # angles inbetween joints and use the resulting
        # array as the feature vector. Add that to the list.
        for line in fIn:
            features = generateAngles(line)
            testSamples.append(sample(features, labels[index]))
        fIn.close()
        index += 1

    index = 0
    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the file calculate the
        # angles inbetween joints and use the resulting
        # array as the feature vector. Add that to the list.
        for line in fIn:
            features = generateAngles(line)
            testSamples.append(sample(features, labels[index]))
        fIn.close()
        index += 1

    return testSamples
コード例 #3
0
ファイル: testing.py プロジェクト: marine0131/audio_process
def generateOneTestPositionData(means, stdDevs):
    '''
    This creates a list of sample objects that can
    be used for testing. This list is built from the third
    participant's data and uses joint positions as features.
    The poisitions are also normalized as they are added to
    the list.
    '''

    testSamples = []
    index = 0

    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the files, create a feature vector
        # of the raw joint positions. Add that to the list.
        for line in fIn:
            features = returnLine(line)
            samp = sample(features, labels[index])
            samp.normalizeValues(means, stdDevs)
            testSamples.append(samp)
        fIn.close()
        index += 1

    return testSamples
コード例 #4
0
ファイル: testing.py プロジェクト: aliince77/randomForest-1
def generateOneTestPositionData(means, stdDevs):
    '''
    This creates a list of sample objects that can 
    be used for testing. This list is built from the third 
    participant's data and uses joint positions as features.
    The poisitions are also normalized as they are added to 
    the list.
    '''

    testSamples = []
    index = 0

    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the files, create a feature vector
        # of the raw joint positions. Add that to the list.
        for line in fIn:
            features = returnLine(line)
            samp = sample(features, labels[index])
            samp.normalizeValues(means, stdDevs)
            testSamples.append(samp)
        fIn.close()
        index += 1

    return testSamples
コード例 #5
0
ファイル: rt_detect.py プロジェクト: marine0131/randomForest
def generateDetectData(feat):
    '''
    This creates a list of data samples to be tested.
    Theses samples are from participants 2 and 3 and
    the calculated angles are used as features.
    '''
    detectSamples = []

    for line in feat:
        features = np.array(line)
        detectSamples.append(sample(features))

    return detectSamples
コード例 #6
0
ファイル: testing.py プロジェクト: marine0131/audio_process
def generateTwoTestPositionData(means, stdDevs):
    '''
    This creates a list of data samples to be tested.
    Theses samples are from participants 2 and 3 and
    the joint poisitions are used as features.
    '''
    testSamples = []
    index = 0

    for filename in sub2:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the files, create a feature vector
        # of the raw joint positions. Add that to the list.
        for line in fIn:
            features = returnLine(line)
            samp = sample(features, labels[index])
            samp.normalizeValues(means, stdDevs)
            testSamples.append(samp)
        fIn.close()
        index += 1

    index = 0

    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the files, create a feature vector
        # of the raw joint positions. Add that to the list.
        for line in fIn:
            features = returnLine(line)
            samp = sample(features, labels[index])
            samp.normalizeValues(means, stdDevs)
            testSamples.append(samp)
        fIn.close()
        index += 1

    return testSamples
コード例 #7
0
ファイル: testing.py プロジェクト: aliince77/randomForest-1
def generateTwoTestPositionData(means, stdDevs):
    '''
    This creates a list of data samples to be tested.
    Theses samples are from participants 2 and 3 and
    the joint poisitions are used as features.
    '''
    testSamples = []
    index = 0

    for filename in sub2:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the files, create a feature vector
        # of the raw joint positions. Add that to the list.
        for line in fIn:
            features = returnLine(line)
            samp = sample(features, labels[index])
            samp.normalizeValues(means, stdDevs)
            testSamples.append(samp)
        fIn.close()
        index += 1

    index = 0 

    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the files, create a feature vector
        # of the raw joint positions. Add that to the list.
        for line in fIn:
            features = returnLine(line)
            samp = sample(features, labels[index])
            samp.normalizeValues(means, stdDevs)
            testSamples.append(samp)
        fIn.close()
        index += 1

    return testSamples
コード例 #8
0
ファイル: my_test.py プロジェクト: marine0131/randomForest
def generateDetectData(filename):
    '''
    This creates a list of data samples to be tested.
    Theses samples are from participants 2 and 3 and
    the calculated angles are used as features.
    '''
    detectSamples = []

    # Open the file
    fIn = open(filename, 'r')
    for line in fIn:
        features = np.array(json.loads(line)['feature'])
        detectSamples.append(sample(features))
    fIn.close()

    return detectSamples
コード例 #9
0
ファイル: testing.py プロジェクト: marine0131/audio_process
def generateOneTestAngleData():
    '''
    This creates a list of sample objects that can
    be used for testing. This list is built from the third
    participant's data and uses angles as features.
    '''

    testSamples = []
    index = 0

    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the file calculate the
        # angles inbetween joints and use the resulting
        # array as the feature vector. Add that to the list.
        for line in fIn:
            features = generateAngles(line)
            testSamples.append(sample(features, labels[index]))
        fIn.close()
        index += 1

    return testSamples
コード例 #10
0
ファイル: testing.py プロジェクト: aliince77/randomForest-1
def generateOneTestAngleData():
    '''
    This creates a list of sample objects that can 
    be used for testing. This list is built from the third 
    participant's data and uses angles as features.
    '''

    testSamples = []
    index = 0

    for filename in sub3:
        #Open the file
        fIn = open(filename, 'r')
        #For each line of the file calculate the 
        # angles inbetween joints and use the resulting 
        # array as the feature vector. Add that to the list.
        for line in fIn:
            features = generateAngles(line)
            testSamples.append(sample(features, labels[index]))
        fIn.close()
        index += 1

    return testSamples