public static void CreateTest() { Console.WriteLine("读取用户基本数据(测试集)"); var user_test = BasicInfo_Test.ReadCSV(@"F:\诈骗电话识别\诈骗电话号码识别-0527\test\test_user.csv"); Console.WriteLine("件数:" + user_test.Count); Console.WriteLine("读取用户APP数据(测试集)"); var app_test = AppInfo.ReadCSV(@"F:\诈骗电话识别\诈骗电话号码识别-0527\test\test_app.csv"); Console.WriteLine("件数:" + app_test.Count); Console.WriteLine("读取用户VOC数据(测试集)"); var voc_test = VocInfo.ReadCSV(@"F:\诈骗电话识别\诈骗电话号码识别-0527\test\test_voc.csv"); Console.WriteLine("件数:" + voc_test.Count); Console.WriteLine("读取用户SMS数据(测试集)"); var sms_test = SMSInfo.ReadCSV(@"F:\诈骗电话识别\诈骗电话号码识别-0527\test\test_sms.csv"); Console.WriteLine("件数:" + sms_test.Count); //app数据分组 output(user_test, App_Agg.GetAgg(app_test), Voc_Agg.GetAgg(voc_test), SMS_Agg.GetAgg(sms_test), @"F:\诈骗电话识别\诈骗电话号码识别-0527\test_all.csv"); }
public static List <BasicInfo_Test> ReadCSV(string filename) { var df = new List <BasicInfo_Test>(); var sr = new StreamReader(filename); sr.ReadLine(); //第一行 while (!sr.EndOfStream) { var rawinfo = sr.ReadLine().Split(","); var r = new BasicInfo_Test(); r.phone_no_m = rawinfo[0]; r.city_name = rawinfo[1]; r.county_name = rawinfo[2]; r.idcard_cnt = int.Parse(rawinfo[3]); r.arpu_avg = Common.ParseDouble(rawinfo[4]); if (double.IsNaN(r.arpu_avg)) { r.arpu_avg = 0; } df.Add(r); } sr.Close(); return(df); }