如何建设网站?,智慧校园,生产企业做网站有用吗,自己做的网站打开是乱码1、赛题数据赛题以预测二手车的交易价格为任务#xff0c;数据集报名后可见并可下载#xff0c;该数据来自某交易平台的二手车交易记录#xff0c;总数据量超过40w#xff0c;包含31列变量信息#xff0c;其中15列为匿名变量。为了保证比赛的公平性#xff0c;将会从中抽…1、赛题数据赛题以预测二手车的交易价格为任务数据集报名后可见并可下载该数据来自某交易平台的二手车交易记录总数据量超过40w包含31列变量信息其中15列为匿名变量。为了保证比赛的公平性将会从中抽取15万条作为训练集5万条作为测试集A5万条作为测试集B同时会对name、model、brand和regionCode等信息进行脱敏
2、评测标准
评价标准为MAE(Mean Absolute Error)。 MAE越小说明模型预测得越准确。 赛事官网 零基础入门数据挖掘 - 二手车交易价格预测
3、具体步骤
3.1、环境pycharm python3
3.2、读取数据
下面展示一些 内联代码片。
// An highlighted block
var foo bar;
#读取数据并#切分数据dataset pd.read_csv(rC:\python3\envs\pytorch\atest_torch\data\used_car_train_20200313.csv, sep )# print(dataset)# print(dataset.columns.values)X dataset[[SaleID, name, regDate, model, brand, bodyType, fuelType, gearbox, power, kilometer,notRepairedDamage, regionCode, seller, offerType, creatDate, v_0, v_1, v_2,v_3, v_4, v_5, v_6, v_7, v_8, v_9, v_10, v_11, v_12, v_13, v_14]]Y dataset[price]
12345678910
#需要注意因为该csv文件数据是按一个空格隔开的在读取时需要用sep’ 来分割开来。
3.2.2查看各列数据类型
#查看各列数据类型
print([X[column].dtypes for column in X])
12
发现notRepairedDamage数据存在异常该特征为汽车有尚未修复的损坏是0否1。 我将“-”进行缺失值处理赋值为0.5 更新时间2020年3月17日
3.3拆分数据集与测试集
X_train, X_test, Y_train, Y_test train_test_split(X, Y, test_size0.33, random_state7)
1
3.4xgboost构建模型 /divlink hrefhttps://csdnimg.cn/release/phoenix/mdeditor/markdown_views-b6c3c6d139.css relstylesheetdiv classmore-toolboxdiv classleft-toolboxul classtoolbox-listli classtool-item tool-active is-like a hrefjavascript:;svg classicon aria-hiddentrueuse xlink:href#csdnc-thumbsup/use/svgspan classname点赞/spanspan classcount/span/a/lili classtool-item tool-active is-collection a hrefjavascript:; data-report-click{quot;modquot;:quot;popu_824quot;}svg classicon aria-hiddentrueuse xlink:href#icon-csdnc-Collection-G/use/svgspan classname收藏/span/a/lili classtool-item tool-active is-sharea hrefjavascript:; data-report-click{quot;modquot;:quot;1582594662_002quot;}svg classicon aria-hiddentrueuse xlink:href#icon-csdnc-fenxiang/use/svg分享/a/li!--打赏开始--!--打赏结束--li classtool-item tool-moreasvg t1575545411852 classicon viewBox0 0 1024 1024 version1.1 xmlnshttp://www.w3.org/2000/svg p-id5717 xmlns:xlinkhttp://www.w3.org/1999/xlink width200 height200defsstyle typetext/css/style/defspath dM179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z p-id5718/pathpath dM509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z p-id5719/pathpath dM846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z p-id5720/path/svg/aul classmore-boxli classitema classarticle-report文章举报/a/li/ul/li/ul/div/divdiv classperson-messageboxdiv classleft-messagea hrefhttps://blog.csdn.net/zxxmximg srchttps://profile.csdnimg.cn/D/A/8/3_zxxmx classavatar_pic usernamezxxmximg srchttps://g.csdnimg.cn/static/user-reg-year/1x/2.png classuser-years/a/divdiv classmiddle-messagediv classtitlespan classtita hrefhttps://blog.csdn.net/zxxmx data-report-click{quot;modquot;:quot;popu_379quot;} target_blankzxxmx/a/span/divdiv classtextspan发布了1 篇原创文章/span · span获赞 0/span · span访问量 105/span/div/divdiv classright-messagea hrefhttps://im.csdn.net/im/main.html?userNamezxxmx target_blank classbtn btn-sm btn-red-hollow bt-button personal-letter私信/aa classbtn btn-sm bt-button personal-watch data-report-click{quot;modquot;:quot;popu_379quot;}关注/a/div/div/div