LSTM进行房价预测

提示:以下是本篇文章正文内容,下面案例可供参考

1.引入库

import pandas as pd
import numpy as np
import tensorflow as tf

from sklearn.preprocessing import MinMaxScaler, LabelEncoder
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense, Dropout

from matplotlib import pyplot as plt
%matplotlib inline

2.读入数据

raw_data = pd.read_csv("C:/Users/ROG/Desktop/report1/dataset/train.csv")
raw_data.drop('Id', axis=1, inplace=True)
raw_data.info()

3.连续数值归一化

numeric_features =raw_data.dtypes[raw_data.dtypes != 'object' ].index
numeric_features=numeric_features[:-1]#不对房价处理
raw_data[numeric_features] = raw_data[numeric_features].apply(lambda x: (x - x.mean())/(x.std()))
raw_data.info()

4.用均值0填充空缺

<
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值