import numpy as np import matplotlib.pyplot as plt def loadDataSet(fileName,delim = '\t'): fr = open(fileName) stringArr = [line.strip().split(delim) for line in fr.readlines()] datArr = [list(map(float, line)) for line in stringArr] datArr = np.mat(datArr)[:, 1:] m, n = np.shape