def constructTrainingData(trainDataSize): #training data trainData = dataReader.getTrainData(trainDataSize) trainData = trainData.append(dataReader.getSuffixDataFrame()) # feature engineering trainData = regularFeatExtr.convertTargetFeatureToNumeric(trainData) xTrain, yTrain = regularFeatExtr.getRegularFeatures(trainData, True) return xTrain,yTrain
def testParameterPerformance(): startTime = time.time() allAlgorithmStartTime = startTime # define sizes trainDataSize = 10000 testDataSize = 100000 trainData,testData = utils.getDifferentTrainAndTestData(trainDataSize,testDataSize) #in order to assure that we have members form each class present testData = testData.append(dataReader.getSuffixDataFrame()) classifier = trainClassifierOnTrainingData(trainData=trainData) xTest,yTest = constructTestData(testData) yPred = classifier.predict(xTest) validator.performValidation(yPred, yTest) print("Total run time:{} s".format((time.time() - allAlgorithmStartTime)))