Ejemplo n.º 1
0
import numpy as np
import matplotlib.pyplot as plt

from scipy.spatial.distance import euclidean
from abraxasOne.helperFunctions import writeMatrixToCsvFile
from abraxasThree.classifierClass import AbraxasClassifier
from fastdtw import fastdtw
from abraxasOne.gaussFilter import gaussFilter

b = AbraxasClassifier(numIrSensors=10,
                      numFrSensors=2,
                      windowWidth=150,
                      windowShift=150,
                      numFreqs=0,
                      numCoeffs=0,
                      enaStatFeats=False,
                      featNormMethod='none',
                      kernel=0,
                      trainFraction=2 / 3,
                      waveletLvl1=False,
                      randomSortTT=False,
                      classSortTT=True)
b.setWindowFunction(functionName='tukey', alpha=0.15)
# b.plotWindowFunction()

b.selectSensorSubset(selectedSensors=[False, False, False], sensorType='bno')
b.selectSensorSubset(selectedSensors=[], sensorType='fr')
b.selectSensorSubset(selectedSensors=[0, 1, 2, 4, 6, 8], sensorType='ir')
b.addDataFiles(fileSourceName="igor.txt",
               fileSourcePath="../",
               startTime=100,
Ejemplo n.º 2
0
sys.path.append('../')
from abraxasThree.classifierClass import AbraxasClassifier

# user identification:
import numpy as np
import random
# user identification:

a = AbraxasClassifier(numIrSensors=10,
                      numFrSensors=2,
                      windowWidth=100,
                      windowShift=25,
                      numFreqs=3,
                      numCoeffs=10,
                      enaStatFeats=False,
                      featNormMethod='stand',
                      kernel='rbf',
                      trainFraction=2 / 3,
                      waveletLvl1=True,
                      randomSortTT=False,
                      classSortTT=True,
                      corrPeaks=2,
                      enaRawFeats=True)

a.setWindowFunction(functionName='tukey', alpha=0.9)
# a.plotWindowFunction()

a.selectSensorSubset(selectedSensors=[False, True, True], sensorType='bno')
a.selectSensorSubset(selectedSensors=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
                     sensorType='ir')
Ejemplo n.º 3
0
import numpy as np
import matplotlib.pyplot as plt
from abraxasThree.classifierClass import AbraxasClassifier
from misc.kernelDensityEstimator import kernelDensityEstimator

a = AbraxasClassifier(numIrSensors=10,
                      numFrSensors=2,
                      windowWidth=100,
                      windowShift=100,
                      numFreqs=0,
                      numCoeffs=0,
                      enaStatFeats=True,
                      featNormMethod='stand',
                      trainFraction=2 / 3,
                      waveletLvl1=False,
                      randomSortTT=False,
                      classSortTT=True)

a.selectSensorSubset(selectedSensors=[False, False, False], sensorType='bno')
# a.selectSensorSubset(selectedSensors=[0, 2, 4, 6, 8], sensorType='ir')
# a.selectSensorSubset(selectedSensors=[], sensorType='fr')

#a.addDataFiles(fileSourceName="igor.txt", fileSourcePath="../", startTime=3550, stopTime=3800, label=0,
#                className="not walking")
# a.addDataFiles(fileSourceName="igor2.txt", fileSourcePath="../", startTime=300, stopTime=500, label=0)
# a.addDataFiles(fileSourceName="ankita.txt", fileSourcePath="../", startTime=0, stopTime=150, label=0)
# a.addDataFiles(fileSourceName="markusSchnell.txt", fileSourcePath="../", startTime=4100, stopTime=4300, label=0)
# a.addDataFiles(fileSourceName="stefan.txt", fileSourcePath="../", startTime=7600, stopTime=8600, label=0)
# a.addDataFiles(fileSourceName="stefan.txt", fileSourcePath="../", startTime=0, stopTime=300, label=0)
# a.addDataFiles(fileSourceName="ben.txt", fileSourcePath="../", startTime=0, stopTime=1000, label=0)
# a.addDataFiles(fileSourceName="ben.txt", fileSourcePath="../", startTime=7100, stopTime=8000, label=0)
Ejemplo n.º 4
0
def quitApp():
    stopClassifier()
    stopRecording()
    master.quit()


if __name__ == '__main__':

    a = AbraxasClassifier(numIrSensors=10,
                          numFrSensors=2,
                          windowWidth=100,
                          windowShift=10,
                          numFreqs=15,
                          numCoeffs=15,
                          enaStatFeats=True,
                          featNormMethod='stand',
                          kernel='rbf',
                          trainFraction=1,
                          waveletLvl1=True,
                          randomSortTT=False,
                          classSortTT=True)

    from tkinter import *

    master = Tk()
    Label(master, text="File Name:").grid(row=0)

    e1 = Entry(master)

    e1.grid(row=0, column=1)
Ejemplo n.º 5
0
import numpy as np
import matplotlib.pyplot as plt

from scipy.spatial.distance import euclidean
from abraxasOne.helperFunctions import writeMatrixToCsvFile
from abraxasThree.classifierClass import AbraxasClassifier
from fastdtw import fastdtw
from abraxasOne.gaussFilter import gaussFilter

b = AbraxasClassifier(numIrSensors=10,
                      numFrSensors=2,
                      windowWidth=250,
                      windowShift=250,
                      numFreqs=0,
                      numCoeffs=0,
                      enaStatFeats=False,
                      featNormMethod='none',
                      kernel=0,
                      trainFraction=2 / 3,
                      waveletLvl1=False,
                      randomSortTT=False,
                      classSortTT=True)
b.setWindowFunction(functionName='tukey', alpha=0.5)
# b.plotWindowFunction()

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

# b.addDataFiles(fileSourceName="igor.txt", fileSourcePath="../", startTime=100, stopTime=1500, label=0,
Ejemplo n.º 6
0
from abraxasThree.classifierClass import AbraxasClassifier

a = AbraxasClassifier(numIrSensors=1,
                      numFrSensors=0,
                      windowWidth=1500,
                      windowShift=10,
                      numFreqs=0,
                      numCoeffs=0,
                      enaStatFeats=False,
                      featNormMethod='stand',
                      trainFraction=2 / 3,
                      waveletLvl1=False,
                      randomSortTT=False,
                      classSortTT=True)

a.setFileSink(fileSinkName="test.txt", fileSinkPath="../")
a.setWindowFunction(functionName='rect', alpha=0)
a.setupSerialInterface(port="/dev/ttyACM0", baudRate=57600)
a.startReceiveData()
a.startPlotStreamData(sensorNr=[5, 7, 8, 10])
import numpy as np
from abraxasThree.classifierClass import AbraxasClassifier
from sklearn import svm
from xgboost import XGBClassifier
import matplotlib.pyplot as plt
from sklearn.feature_selection import RFE

a = AbraxasClassifier(numIrSensors=10,
                      numFrSensors=2,
                      windowWidth=100,
                      windowShift=50,
                      numFreqs=3,
                      numCoeffs=10,
                      enaStatFeats=False,
                      featNormMethod='stand',
                      trainFraction=2 / 3,
                      waveletLvl1=False,
                      randomSortTT=False,
                      classSortTT=True,
                      enaRawFeats=False,
                      corrPeaks=2)

a.setWindowFunction(functionName='tukey', alpha=0.9)
# a.plotWindowFunction()

a.selectSensorSubset(selectedSensors=[False, True, True], sensorType='bno')
# a.selectSensorSubset(selectedSensors=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], sensorType='ir')
# a.selectSensorSubset(selectedSensors=[0, 1], sensorType='fr')

a.addDataFiles(fileSourceName="igor.txt",
               fileSourcePath="../",