python二手车价格预测_天池_二手车交易价格预测数据分析

本文介绍了使用Python进行二手车价格预测的数据分析过程,包括数据读取、缺失值处理、特征分析等步骤。通过对交易数据的描述性统计、相关性分析和特征可视化,探讨了影响价格的因素,如车型、里程、匿名特征等。
摘要由CSDN通过智能技术生成

字典

FieldDescription

SaleID

交易ID,唯一编码

name

汽车交易名称,已脱敏

regDate

汽车注册日期,例如20160101,2016年01月01日

model

车型编码,已脱敏

brand

汽车品牌,已脱敏

bodyType

车身类型:豪华轿车:0,微型车:1,厢型车:2,大巴车:3,敞篷车:4,双门汽车:5,商务车:6,搅拌车:7

fuelType

燃油类型:汽油:0,柴油:1,液化石油气:2,天然气:3,混合动力:4,其他:5,电动:6

gearbox

变速箱:手动:0,自动:1

power

发动机功率:范围 [ 0, 600 ]

kilometer

汽车已行驶公里,单位万km

notRepairedDamage

汽车有尚未修复的损坏:是:0,否:1

regionCode

地区编码,已脱敏

seller

销售方:个体:0,非个体:1

offerType

报价类型:提供:0,请求:1

creatDate

汽车上线时间,即开始售卖时间

price

二手车交易价格(预测目标)

v系列特征

匿名特征,包含v0-14在内15个匿名特征

step1:导入模块

## 基础工具

importnumpy as npimportpandas as pdimportwarningsimportmatplotlibimportmatplotlib.pyplot as pltimportseaborn as snsfrom scipy.special importjnfrom IPython.display importdisplay, clear_outputimporttime

warnings.filterwarnings('ignore')%matplotlib inline## 模型预测的

from sklearn importlinear_modelfrom sklearn importpreprocessingfrom sklearn.svm importSVRfrom sklearn.ensemble importRandomForestRegressor,GradientBoostingRegressor## 数据降维处理的

from sklearn.decomposition importPCA,FastICA,FactorAnalysis,SparsePCAimportlightgbm as lgbimportxgboost as xgb## 参数搜索和评价的

from sklearn.model_selection importGridSearchCV,cross_val_score,StratifiedKFold,train_test_splitfrom sklearn.metrics import mean_squared_error, mean_absolute_error

step2:数据读取

#导入训练集和测试集

train_data =pd.read_csv('F:\\python\\天池_二手车交易价格预测\\used_car_train_20200313.csv',sep=' ')

test_da

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值