Lasso回归模型二手汽车价格预测

该博客通过数据读取、缺失值处理、特征相关性分析、预处理(归一化、分类处理)、建立Lasso回归模型以及预测检验,探讨了如何运用Lasso回归模型预测二手汽车价格。在特征相关性分析中,发现6组相关特征,并进行了模型参数调整,最终通过残差图和评价指标(MSE和R²)评估模型性能。
摘要由CSDN通过智能技术生成

下载missingno文档,解压到项目同一文件夹下。

链接:https://share.weiyun.com/I6eHxC6Q 密码:vx5x4r

 

数据集文档csv

链接:https://share.weiyun.com/b0rElSNA 密码:efygdy

数据集
dataname datameans datatype
bike_name full name of the bike object
price resale price of the bike int64
city city where Bike was listed object
kms_driven kilometers driven by bike int64
owner number of owners of the bike object
age age of the bike int64
power power of the bike in CC int64
brand brand of the bike object

 

 

 

 

 

 

 

 

 

一、数据读取与分析

"""
Created on Tue Jun  2 01:80:694 2021

@author: Win7
"""
#20180694#
import numpy as np
import pandas as pd
from pandas import datetime
#pandas文档:http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html#pandas.DataFrame
 
#作图库
import matplotlib.pyplot as plt
#matplotlib文档:https://matplotlib.org/gallery/index.html
import seaborn as sns 
import missingno as msno # missing values 缺失值可视化展示
#20180694 
#missingno文档 https://github.com/ResidentMario/missingno
#***务必下载missingno压缩包,解压到项目所在文件夹***

#适用于jupyter notebook,spyder等编辑器
%matplotlib inline
 
# machine learning 机器学习工具包
from statsmodels.distributions.empirical_distribution import ECDF  #ECDF:累积分布函数
from sklearn.metrics import mean_squared_error, r2_score#2
from sklearn.preproc
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值