数据分析之工业蒸汽量预测

导包

import numpy as np
import pandas as pd
from pandas import Series,DataFrame

import matplotlib.pyplot as plt
import matplotlib as mtl
%matplotlib inline

import seaborn as sns
sns.set()
import warnings
warnings.filterwarnings("ignore")

导入数据

with open("./zhengqi_train.txt") as fr:
    data_train = pd.read_table(fr,"\t")
with open("./zhengqi_test.txt") as fr_test:
    data_test = pd.read_table(fr_test,"\t")

查看数据集的基本信息

data_train.shape,data_test.shape

data_train.describe()
data_test.describe()

data_train.info(),data_test.info()

第一步清洗,清洗分布不均衡的数据

# 第一步,画图对比测试集和训练集的分布情况,删除分布不太均衡的数据
# g = plt.subplot()
sns.set()
for column_train in data_train.columns.tolist()[:-1]:
    fig = plt.figure(figsize=(8,5))
    g = plt.subplot()
    sns.kdeplot(data_train[column_train],color='red',ax=g ,label='Train',shade=True)
    sns.kdeplot(data_test[column_train],color="blue",ax=g ,label="Test",shade=True)
    g.set_xlabel(column_train)
    g.set_ylabel("Frequency")
  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值