data = pd.read_csv("./dataNN.csv",',',error_bad_lines=False)#我的数据集是两列,一列字符串,一列为0,1的labeldata = np.array(data)random.shuffle(data)#随机打乱#取前70%为训练集allurl_fea = [d[0] for d in data]df1=data[:int(0.7*len(allurl_fea))]#将np.array转为dataframe,并对两列赋列名df1=…
# -*- coding: utf-8 -*- """ Created on Tue Jun 23 15:24:19 2015 @author: hd """ from sklearn import cross_validation c = [] j=0 filename = r'C:\Users\hd\Desktop\bookmarks\bookmarks.arff' out_train = open(r'C:\Users\hd\Desktop…