Example #1
0
def getRabeData(sensors, length, shift=256):
    from abraxas4.abraxasFrame import AbraxasFrame
    b = AbraxasFrame(numIrSensors=10, numFrSensors=2, windowWidth=length, windowShift=shift, numFreqs=0, numCoeffs=0,
                          enaStatFeats=False, featNormMethod='none', trainFraction=2/3, waveletLvl1=False,
                          randomSortTT=False, classSortTT=True)

    b.setWindowFunction(functionName='rect', alpha=0.25)
    # b.plotWindowFunction()

    b.selectSensorSubset(selectedSensors=[False, False, False], sensorType='bno')
    b.selectSensorSubset(selectedSensors=[], sensorType='fr')
    b.selectSensorSubset(selectedSensors=sensors, sensorType='ir')
    #b.selectSensorSubset(selectedSensors=[2], sensorType='ir')

    b.addDataFiles(fileSourceName="igor2.txt", fileSourcePath="../", startTime=600, stopTime=6000, label=0)

    b.addDataFiles(fileSourceName="ankita_pos2_lrRl.txt", fileSourcePath="../", startTime=150, stopTime=2500, label=1)

    b.addDataFiles(fileSourceName="markus.txt", fileSourcePath="../", startTime=500, stopTime=3300, label=2)

    dataSet = b.readDataSet(checkData=False, equalLength=True)
    # dataSet := Array with shape dataSet[i][j, k], where i refers to the i-th file loaded, k indicates the sensor and
    #         j is the "time"-index.

    wData, wLabels = b.windowSplitSourceDataTT(inputData=dataSet, inputLabels=np.array([0, 1, 2]))

    wLabels = np.array(wLabels)
    print("Number of windows, Igor: ", str(np.size(wLabels[wLabels == 0])))
    print("Number of windows, Ankita: ", str(np.size(wLabels[wLabels == 1])))
    print("Number of windows, Markus: ", str(np.size(wLabels[wLabels == 2])))

    igor = []
    ankita = []
    markus = []

    #for i in range(len(wLabels)):
    #    wData[i] = wData[i]*(1+0*np.random.random([250, 1]))

    for i in range(len(wLabels)):
        if wLabels[i]==0:
            igor.append(wData[i]*1)
        if wLabels[i]==1:
            ankita.append(wData[i]*1)
        if wLabels[i]==2:
            markus.append(wData[i]*1)
    return igor, ankita, markus
Example #2
0
                 featNormMethod='none',
                 trainFraction=2 / 3,
                 waveletLvl1=False,
                 randomSortTT=False,
                 classSortTT=True)

b.setWindowFunction(functionName='rect', alpha=0.25)
# b.plotWindowFunction()

b.selectSensorSubset(selectedSensors=[False, False, False], sensorType='bno')
b.selectSensorSubset(selectedSensors=[], sensorType='fr')
b.selectSensorSubset(selectedSensors=[0, 1, 2, 3, 5, 7, 9], sensorType='ir')

b.addDataFiles(fileSourceName="igor2.txt",
               fileSourcePath="../",
               startTime=600,
               stopTime=6000,
               label=0)

b.addDataFiles(fileSourceName="ankita_pos2_lrRl.txt",
               fileSourcePath="../",
               startTime=150,
               stopTime=2500,
               label=1)

b.addDataFiles(fileSourceName="markus.txt",
               fileSourcePath="../",
               startTime=500,
               stopTime=3300,
               label=2)
Example #3
0
                           wavelet='haar',
                           waveletLvl1=False,
                           featNormMethod='stand',
                           trainFraction=0.66,
                           classSortTT=True,
                           randomSortTT=False,
                           lineThresholdAfterNorm=10,
                           enaRawFeats=False,
                           corrPeaks=2)

    xgbAbra.selectSensorSubset(selectedSensors=[False, True, True],
                               sensorType='bno')

    xgbAbra.addDataFiles(fileSourceName="igor.txt",
                         fileSourcePath="../",
                         startTime=3550,
                         stopTime=3800,
                         label=0,
                         className="not walking")
    xgbAbra.addDataFiles(fileSourceName="igor2.txt",
                         fileSourcePath="../",
                         startTime=300,
                         stopTime=500,
                         label=0)
    xgbAbra.addDataFiles(fileSourceName="ankita.txt",
                         fileSourcePath="../",
                         startTime=0,
                         stopTime=150,
                         label=0)
    xgbAbra.addDataFiles(fileSourceName="markusSchnell.txt",
                         fileSourcePath="../",
                         startTime=4100,
Example #4
0
                  waveletLvl1=False,
                  randomSortTT=False,
                  classSortTT=True,
                  corrPeaks=0,
                  enaRawFeats=False,
                  statStages=3)

oc.setWindowFunction(functionName='tukey', alpha=0.1)

oc.selectSensorSubset(selectedSensors=[False, True, True], sensorType='bno')
# oc.selectSensorSubset(selectedSensors=[], sensorType='fr')
# oc.selectSensorSubset(selectedSensors=[0], sensorType='ir')

oc.addDataFiles(fileSourceName="chrisOut2.txt",
                fileSourcePath="../",
                startTime=1500,
                stopTime=5000,
                label=0)
oc.addDataFiles(fileSourceName="chrisOut2.txt",
                fileSourcePath="../",
                startTime=8000,
                stopTime=13000,
                label=0)
oc.addDataFiles(fileSourceName="chrisOut2.txt",
                fileSourcePath="../",
                startTime=15000,
                stopTime=20000,
                label=0)
oc.addDataFiles(fileSourceName="chrisOut2.txt",
                fileSourcePath="../",
                startTime=7500,
Example #5
0
                  waveletLvl1=False,
                  randomSortTT=False,
                  classSortTT=True,
                  corrPeaks=0,
                  enaRawFeats=False,
                  statStages=4)

oc.setWindowFunction(functionName='tukey', alpha=0.9)

oc.selectSensorSubset(selectedSensors=[False, True, True], sensorType='bno')
# oc.selectSensorSubset(selectedSensors=[], sensorType='fr')
# oc.selectSensorSubset(selectedSensors=[0], sensorType='ir')

oc.addDataFiles(fileSourceName="igor.txt",
                fileSourcePath="../",
                startTime=100,
                stopTime=1500,
                label=0,
                className="walking")
oc.addDataFiles(fileSourceName="igor2.txt",
                fileSourcePath="../",
                startTime=600,
                stopTime=6000,
                label=0)

oc.addDataFiles(fileSourceName="ankita.txt",
                fileSourcePath="../",
                startTime=200,
                stopTime=1900,
                label=0)
oc.addDataFiles(fileSourceName="ankita_pos2_lrRl.txt",
                fileSourcePath="../",
Example #6
0
 - user identification (with non walking data) using decision tree alg

"""

from abraxas4.abraxasFrame import AbraxasFrame

gNbAbra = AbraxasFrame(numIrSensors=10, numFrSensors=2, windowWidth=50, windowShift=50, numFreqs=1, numCoeffs=1,
                 enaStatFeats=True, featNormMethod='minmax', trainFraction=2/3, waveletLvl1=False, randomSortTT=False,
                 classSortTT=True, corrPeaks=0, enaRawFeats=False)

gNbAbra.setWindowFunction(functionName='tukey', alpha=0.1)

gNbAbra.selectSensorSubset(selectedSensors=[False, False, False], sensorType='bno')
gNbAbra.selectSensorSubset(selectedSensors=[0, 1, 2], sensorType='ir')
gNbAbra.selectSensorSubset(selectedSensors=[], sensorType='fr')
'''
gNbAbra.addDataFiles(fileSourceName="igor.txt", fileSourcePath="../", startTime=3550, stopTime=3800, label=0,
               className="not walking")
gNbAbra.addDataFiles(fileSourceName="igor2.txt", fileSourcePath="../", startTime=300, stopTime=500, label=0)
gNbAbra.addDataFiles(fileSourceName="ankita.txt", fileSourcePath="../", startTime=0, stopTime=150, label=0)
gNbAbra.addDataFiles(fileSourceName="markusSchnell.txt", fileSourcePath="../", startTime=4100, stopTime=4300, label=0)
gNbAbra.addDataFiles(fileSourceName="stefan.txt", fileSourcePath="../", startTime=7600, stopTime=8600, label=0)
gNbAbra.addDataFiles(fileSourceName="stefan.txt", fileSourcePath="../", startTime=0, stopTime=300, label=0)
gNbAbra.addDataFiles(fileSourceName="ben.txt", fileSourcePath="../", startTime=0, stopTime=1000, label=0)
gNbAbra.addDataFiles(fileSourceName="ben.txt", fileSourcePath="../", startTime=7100, stopTime=8000, label=0)
gNbAbra.addDataFiles(fileSourceName="chris1.txt", fileSourcePath="../", startTime=5200, stopTime=6000, label=0)
gNbAbra.addDataFiles(fileSourceName="novcc.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=0)
gNbAbra.addDataFiles(fileSourceName="nowalk.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=0)
gNbAbra.addDataFiles(fileSourceName="nowalk2.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=0)
gNbAbra.addDataFiles(fileSourceName="nowalk3.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=0)
gNbAbra.addDataFiles(fileSourceName="chris2.txt", fileSourcePath="../", startTime=0, stopTime=1000, label=0)