python读取文本数据到矩阵(用于scikit-learn输入)
def load_data(): train = numpy.loadtxt(open("D:\dev_src\python\weibo_keywords\extra_dict\word_feature_train.csv", "rb"), delimiter=",", skiprows=0) test = numpy.loadtxt(open("D:\dev_src\python\weibo_keywords\extra_dict\word_feature_test.csv", "rb"), delimiter=",", skiprows=0) train_x = train[:,0:2] train_y = train[:,2]
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: 重复数组中的二分查找
- 下一篇: java程序与操作系统API的关系