- user identification (with non walking data) using xgboost """ from abraxas4.abraxasFrame import AbraxasFrame xgbAbra = AbraxasFrame(numIrSensors=10, numFrSensors=2, windowWidth=100, windowShift=25, numCoeffs=5, numFreqs=1, enaStatFeats=True, wavelet='haar', waveletLvl1=False, featNormMethod='stand', trainFraction=0.66, classSortTT=True, randomSortTT=False, lineThresholdAfterNorm=10, enaRawFeats=False, corrPeaks=2) xgbAbra.loadTeTrDump(dumpName='xgbAbra.pkl') #from xgboost import XGBClassifier import xgboost clf = xgboost.XGBClassifier(max_depth=3, learning_rate=0.4) xgbAbra.trainClassifier(classifier=clf, supervised=True) xgbAbra.testClassifier()
label=1) oc.addDataFiles(fileSourceName="novcc.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=1) oc.addDataFiles(fileSourceName="nowalk.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=1) oc.addDataFiles(fileSourceName="nowalk2.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=1) oc.addDataFiles(fileSourceName="nowalk3.txt", fileSourcePath="../", startTime=0, stopTime=10000, label=1) oc.readDataSet(equalLength=False, checkData=False) oc.initFeatNormalization() from sklearn.naive_bayes import GaussianNB model = GaussianNB() oc.trainClassifier(classifier=model) oc.testClassifier()
""" from abraxas4.abraxasFrame import AbraxasFrame dtAbra = AbraxasFrame(numIrSensors=10, numFrSensors=2, windowWidth=100, windowShift=25, numFreqs=1, numCoeffs=0, enaStatFeats=True, featNormMethod='stand', trainFraction=2 / 3, waveletLvl1=False, randomSortTT=False, classSortTT=True, corrPeaks=0, enaRawFeats=False) dtAbra.loadTeTrDump(dumpName='dtAbra.pkl') from sklearn.tree import DecisionTreeClassifier clf = DecisionTreeClassifier(criterion="entropy", max_depth=20, min_samples_leaf=1, min_samples_split=3, max_features=None, max_leaf_nodes=None) dtAbra.trainClassifier(classifier=clf) dtAbra.testClassifier()
className="chris") gNbAbra.addDataFiles(fileSourceName="chris_pos2.txt", fileSourcePath="../", startTime=100, stopTime=1700, label=2) gNbAbra.addDataFiles(fileSourceName="chris1.txt", fileSourcePath="../", startTime=500, stopTime=5000, label=2) gNbAbra.addDataFiles(fileSourceName="chris2.txt", fileSourcePath="../", startTime=1000, stopTime=8600, label=2) gNbAbra.addDataFiles(fileSourceName="chrisOut.txt", fileSourcePath="../", startTime=1000, stopTime=9000, label=2) gNbAbra.addDataFiles(fileSourceName="chrisOut2.txt", fileSourcePath="../", startTime=1000, stopTime=4000, label=2) gNbAbra.addDataFiles(fileSourceName="chrisOut2.txt", fileSourcePath="../", startTime=4250, stopTime=5250, label=2) gNbAbra.addDataFiles(fileSourceName="chrisOut2.txt", fileSourcePath="../", startTime=6000, stopTime=14000, label=2) gNbAbra.addDataFiles(fileSourceName="chrisOut2.txt", fileSourcePath="../", startTime=14000, stopTime=22000, label=2) gNbAbra.addDataFiles(fileSourceName="chris_c.txt", fileSourcePath="../", startTime=100, stopTime=1600, label=3, className="crooked") gNbAbra.addDataFiles(fileSourceName="ben.txt", fileSourcePath="../", startTime=2000, stopTime=6000, label=4, className="ben") gNbAbra.addDataFiles(fileSourceName="markus.txt", fileSourcePath="../", startTime=500, stopTime=3300, label=5, className="markus") gNbAbra.addDataFiles(fileSourceName="igor.txt", fileSourcePath="../", startTime=100, stopTime=2900, label=6, className="igor") gNbAbra.addDataFiles(fileSourceName="igor2.txt", fileSourcePath="../", startTime=600, stopTime=6000, label=6) gNbAbra.readDataSet(equalLength=False, checkData=True) gNbAbra.initFeatNormalization(dumpName="throwAway") from sklearn.naive_bayes import GaussianNB clf = GaussianNB() gNbAbra.trainClassifier(classifier=clf) gNbAbra.testClassifier()