当前位置:网站首页>Matlab simulation of multi-factor house price prediction based on BP neural network
Matlab simulation of multi-factor house price prediction based on BP neural network
2022-08-10 05:09:00 【fpga and matlab】
目录
一、理论基础
The neural network is mainly composed of processing units、网络拓扑结构、Composition of training rules.The processing unit is the basic unit of operation of the neural network,to simulate the function of neurons in the human brain.A processing unit has multiple inputs、输出,The input analog neural dendrites function,to transmit information;Outputs mimic axonal function of cranial nerves,Pass the processed information to the next processing unit,如图1所示.
图1 Neural network basic processing unit
Basic neural processing unit which is equivalent to the human neuron,如图2所示,
图2 Neurons vs. Neural Processing Units
Processing units with the same function form the processing layer.A commonly used multilayer perceptron consists of an input layer、The output layer and several hidden layers are composed of,The topology of the neural network determines the processing units、The way and way of information transmission between layers.The training rule uses the transformation function to weight and sum the data processing,Training the Network System for Pattern Recognition,and convert it into a potential output value.Basic starting point for neural networks,is through multiple iterations of a simple function,Implements fitting and approximation to complex mappings.Neural network can achieve one-to-one、一对多的映射关系.因此,Many practical problems can be solved with neural network models
二、案例背景
1.问题描述
Residential prices are at the heart of the housing market,The change of the housing market is related to the vital interests of the consumers,Commodity house price rise is lower,Sales are cold or prosperous,is a hot issue of social concern.因此,从不同角度来看,There are important theoretical and practical significance in the research on the price of commercial housing.Changes in commodity housing prices are affected by market supply and demand、人口、居民收入水平、Economic policy and many other factors,Its process of changing with time has great uncertainty,In order to more comprehensively describe the impact of various aspects on housing prices,To grasp the future trend of housing prices,The prediction method that will be passed through the neural network theory,Extended application to the research on the price of commercial housing,Make scientific predictions on housing prices.
2.思路流程
The factors that affect the price changes of commercial housing are complex、多变的,It is difficult to all the factors into the analysis and research.But it can be considered that in a period of economic、politically stable period,The change in the price of commercial housing is determined by some basic factors.According to the introduction in Chapter 2 of this paper,Taking into account the realities of the Auckland region,将选取13a major factor as the main factor affecting the price of a house:
·Average crime rate per town;
·住宅用地超过500In proportion to the square;
·Proportion of non-commercial land in each town;
·The distance from the ocean is1公里内,则为1,否则为0;
·Oxide concentration;
·Every house on the number of average room;
·1940Proportion of former self-built houses;
·Weighted distance to shopping center;
·The label of high-speed km;
·每1万美元的管理费;
·教师比例;
·20Proportion of population under the age of;
·Retirement population ratio.
The above factors are expressed as:X1~X13.
三、部分MATLAB仿真
clc;
close all;
clear all;
warning off;
%% Parameters initialization
%load data
load data\housing_data.mat
%Display the original data
figure;
subplot(4,4,1);plot(x(1,:));title('Per capita crime rate per town');
subplot(4,4,2);plot(x(2,:));title('Proportion of residential land zoned for lots over 500m2');
subplot(4,4,3);plot(x(3,:));title('Proportion of non-retail business acres per town');
subplot(4,4,4);plot(x(4,:));title('1 within 1km from the sea, 0 otherwise');
subplot(4,4,5);plot(x(5,:));title('Nitric oxides concentration (parts per 10 million)');
subplot(4,4,6);plot(x(6,:));title('Average number of rooms per dwelling');
subplot(4,4,7);plot(x(7,:));title('Proportion of owner-occupied units built prior to 1940');
subplot(4,4,8);plot(x(8,:));title('Weighted distances to a main shopping center');
subplot(4,4,9);plot(x(9,:));title('Index of accessibility to motorways');
subplot(4,4,10);plot(x(10,:));title('Full-value of council rate per $10,000');
subplot(4,4,11);plot(x(11,:));title('Pupil-teacher ratio by town');
subplot(4,4,12);plot(x(12,:));title('Population below the age of 20');
subplot(4,4,13);plot(x(13,:));title('Percentage of retirees');
figure;
plot(10000*t,'r');title('PRICE');grid on
%% Select multiple data,train neural network
%step1:parameter
net = fitnet(10);
net.trainParam.epcohs = 1000;%train times
net.trainParam.goal = 0.0001;%aim error
%step2:train
net = train(net,x,t);
%% By using the neural network to predict the price of houses
view(net);
y1 = net(x);%predict
%% Shows the result
figure;
subplot(221);plot(t);
title('Original price');axis([0,length(t),0,max(t)]);
subplot(222);plot(y1);
title('Predict prices ');axis([0,length(y1),0,max(y1)]);
subplot(223);plot(y1);hold on;plot(t,'r');hold off;
legend('Predict prices','Original price');
title('Predict prices');axis([0,length(y1),0,max(y1)]);
subplot(224);plot(y1 - t,'k');
title('Prediction error ');
figure
plot(y1);hold on;plot(t,'r');hold off;
legend('Predict prices','Original price');
title('Predict prices');axis([0,length(y1),0,max(y1)]);
figure
plot(y1 - t,'k');grid on;
title('Prediction error ');axis([0,length(y1),-50,50]);
%save networks
save net.mat net
四、仿真结论分析
首先通过“load data\housing_data.mat”语句,You can call the function that needs to be trained toMATLAB的workspace中,Convenient data call.
图1 数据调用
First execute the followingMATLAB指令:
net = fitnet(10);
net.trainParam.epcohs = 1000;
net.trainParam.goal = 0.0001;
The main meaning here is to usefitnetfunction to generate a random neural network,Then set the number of training to1000,The error target for training is set as0.0001.随机产生的netIts information is as follows:
Neural Network
…………………………….
dimensions:
…………………………….
connections:
…………………………….
subobjects:
…………………………….
functions:
…………………………….
weight and bias values:
…………………………….
methods:
…………………………….
evaluate: outputs = net(inputs)
然后开始训练,执行如下的指令:
net= train(net,x,t);
训练完成后,The system will appear the following neural network interface:
图2 Neural Network Interface
通过查看相关的信息,We can see the performance of the whole training process as shown below:
图3 Neural network training curve
Its training error distribution is as follows:
图4 training error distribution
从图4.4可知,After training the neural network,Most data can be distributed around small errors,Individual data will produce large errors.
图5 数据分布
执行view,You can see the designed neural network model:
图4.6Neural network data model
Finally using the designednetFunction for data prediction.
Here, the original sample data is compared with the data predicted by the neural network,其结果如下:
图7 Comparison of original sample data and predicted data
从图7可以看到,The data predicted by the neural network is basically similar to the original data,The error information obtained by subtraction is as follows:
图8 误差曲线
从图8可知,After passing through the neural network,The error between the predicted output value and the sample value is0附近,but for partial values,such as areas with several jumps in house prices,误差较大,This is due to the weak ability to predict emergencies..
五、参考文献
[01]White, H. Economic prediction using neural networks: the case of IBM Gaily stock returns, Neural Networks, IEEE International Conference on,1988,2(6): 451-458.
[02]Kamijo K &Tanigawa T,Stock Price Pattern Recognition: A Recurrent Network Approach. Proceeding of the International Joint Conference on Neural Networks,1990, 215-222.
[03]Youngohc Yoon&George Swales, Predicting Stock Price Per-Formance: A Neural Network Approach, System Sciences, International Conference on,1991. Proceedings of the Twenty-Fourth Annual Hawaii1991,4:156-162.A05-03
边栏推荐
- redis basic data types
- 元宇宙 | 你能通过图灵测试吗?
- 告诉你如何从keil工程知道使用了多少RAM和ROM空间
- tensorflow分词深度学习——影评预测
- flinksql怎么写redis的value只有最后一个字段?
- Shell编程三剑客之awk
- 【Web3 系列开发教程——创建你的第一个 NFT(7)】创建一个 NFT DApp,给你的 NFT 赋予属性,例如图片
- SQLSERVER 2008 解析 Json 格式数据
- 开发智能硬件过程中需要掌握的方法之经典
- What is the relationship between legal representative and shareholders?
猜你喜欢
什么是“大小端字节序”存储模式?
MySQL simple tutorial
小影科技IPO被终止:年营收3.85亿 五岳与达晨是股东
mysql常用命令有什么
成为黑客不得不学的语言,看完觉得你们还可吗?
使用 DatePicker 日期控件,发生 Prop being mutated: “placement“ 报错问题
Hezhou ESP32C3 +1.8"tft network clock under Arduino framework
网络层与数据链路层
Flutter开发:报错The following assertion was thrown resolving an image codec:Unable to…的解决方法
如何从代码层提高产品质量
随机推荐
WAN技术-1广域网接口
FPGA工程师面试试题集锦1~10
ORA-16018 异常处理记录
LeetCode 6138. 最长理想子序列 动态规划
什么是SRM?有什么作用?在企业管理中能实现哪些功能?
大佬们,运行cdc后oracle归档日志20分钟增长3G是正常现象吗
一篇文章掌握整个JVM,JVM超详细解析!!!
告诉你如何从keil工程知道使用了多少RAM和ROM空间
SQL database field to append to main table
Pulsar中游标的工作原理
2022年R2移动式压力容器充装考试题库模拟考试平台操作
众昂矿业:萤石下游需求强劲
使用 DatePicker 日期控件,发生 Prop being mutated: “placement“ 报错问题
转型做产品,考NPDP靠谱吗?
什么是遗留代码:有效地处理遗留代码的8个小贴士
Kubernetes资源编排系列之一: Pod YAML篇
EasyGBS连接mysql数据库提示“can’t connect to mysql server”,该如何解决?
栈与队列 | 有效的括号、删除字符串中的所有相邻元素、逆波兰表达式求值、滑动窗口的最大值、前K个高频元素 | leecode刷题笔记
Guys, is it normal that the oracle archive log grows by 3G in 20 minutes after running cdc?
关于rust的mongodb驱动count方法无法与near条件一同使用的问题