def sequentialFloatingBackwardSelection(naFeatTrain,naFeatTest,lFeatures,classLabelIndex):
	global MAX_ITERATIONS
	lSelectedFeatures = lFeatures[:]
	lRemainingFeatures = list()
	lCorrCoef = list()
	lSeenStates = list()
	while len(lSelectedFeatures) > 0:
		sys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\n')
		sys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\n')
		sys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\n')
		retValue = nextWorstFeature(naFeatTrain,naFeatTest,lSelectedFeatures,classLabelIndex)
		lSelectedFeatures.remove(retValue['worstFeature'])
		lSeenStates.append(set(lSelectedFeatures))
		lRemainingFeatures.append(retValue['worstFeature'])
		lCorrCoef.append(retValue['worstFeatureCorrCoef'])
		while True:
			sys.stdout.write('lSelectedFeatures: ' + str(lSelectedFeatures) + '\n')
			sys.stdout.write('lRemainingFeatures: ' + str(lRemainingFeatures) + '\n')
			sys.stdout.write('lCorrCoef: ' + str(lCorrCoef) + '\n')
			retValue2 = nextBestFeature(naFeatTrain,naFeatTest,lSelectedFeatures,lRemainingFeatures,classLabelIndex)
			if retValue2['bestFeatureCorrCoef'] < lCorrCoef[-1]:
				newState = set(lSelectedFeatures)
				newState.add(retValue2['bestFeature'])
				if newState in lSeenStates:
					sys.stdout.write('feature not added b/c state already seen. \n\n')
					break
				lSelectedFeatures.append(retValue2['bestFeature'])
				lSeenStates.append(set(lSelectedFeatures))
				lRemainingFeatures.remove(retValue2['bestFeature'])
				lCorrCoef.append(retValue2['bestFeatureCorrCoef'])
			else:
				sys.stdout.write('feature not added b/c corr not higher. \n\n')
				break
		if len(lSeenStates) >= MAX_ITERATIONS:
			sys.stdout.write('QUITTING B/C len(lSeenStates) >= MAX_ITERATIONS: ' + str(len(lSeenStates)) + '\n\n')
			break
	
	maxlCorrCoef = max(lCorrCoef)
	maxlCorrCoefIndex = lCorrCoef.index(maxlCorrCoef)
	sys.stdout.write('best feature set is ' + str(list(lSeenStates[maxlCorrCoefIndex])+[classLabelIndex]) + '\n')
	sys.stdout.write('corr coef = ' + str(maxlCorrCoef))
	return maxlCorrCoef
dataset/ETHPy150Open QuantSoftware/QuantSoftwareToolkit/Examples/FeatureSearch/functions.py/sequentialFloatingBackwardSelection/swapped operands of `<`