def file2matrix(filename):
#?????
fr = open(filename)
#??????????
arrayOLines = fr.readlines()
#??????????
numberofLines = len(arrayOLines)
#????numberofLines?????��??????
returnMat = zeros((numberofLines,3))
classLabelVector = []
index = 0
#for??????????????��?????
for line in arrayOLines:
#??line?????????
line = line.strip()
#?????????\t???
listFormLine = line.split('\t')
#??????? ?????��??????????
returnMat [index,:] = listFormLine[0:3]
#??listFormLine???????�՛�??classLabelVector????? ???????int
classLabelVector.append(int(listFormLine[-1]))
index+=1
#???????????????????????
return returnMat,classLabelVector