Created
December 7, 2010 05:06
-
-
Save kvorion/731482 to your computer and use it in GitHub Desktop.
getvalues method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetValues(self): | |
file = open(self.trainingFile, 'r') | |
for line in file: | |
if line[0] != '@': #start of actual data | |
self.featureVectors.append(line.strip().lower().split(',')) | |
else: #feature definitions | |
if line.strip().lower().find('@data') == -1 and (not line.lower().startswith('@relation')): | |
self.featureNameList.append(line.strip().split()[1]) | |
self.features[self.featureNameList[len(self.featureNameList) - 1]] = line[line.find('{')+1: line.find('}')].strip().split(',') | |
file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment