当前位置:网站首页>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
边栏推荐
- 大佬们,mysql cdc(2.2.1跟之前的版本)从savepoint起有时出现这种情况,有没有什
- 【无标题】
- 大佬们,运行cdc后oracle归档日志20分钟增长3G是正常现象吗
- 什么是遗留代码:有效地处理遗留代码的8个小贴士
- Kubernetes资源编排系列之一: Pod YAML篇
- 【u-boot】u-boot驱动模型分析(02)
- 干货 | 查资料利器:线上图书馆
- Ask you guys.The FlinkCDC2.2.0 version in the CDC community has a description of the supported sqlserver version, please
- Shield Alt hotkey in vscode
- WAN技术-1广域网接口
猜你喜欢

Why are negative numbers in binary represented in two's complement form - binary addition and subtraction

【无标题】

awk of the Three Musketeers of Shell Programming

LeetCode·301.删除无效的括号·BFS

ctf-pikachu-file_inclusion

MySQL使用简单教程

An article to master the entire JVM, JVM ultra-detailed analysis!!!

LeetCode 301. Remove Invalid Parentheses BFS

使用 DatePicker 日期控件,发生 Prop being mutated: “placement“ 报错问题

2022 R2 transportable pressure vessel filling operation examination question bank simulation platform
随机推荐
什么是“大小端字节序”存储模式?
线程(上篇):线程的创建
LeetCode 301. Remove Invalid Parentheses BFS
leetcode每天5题-Day12
最强大脑(1)
线性模型中的高级特征选择技术——基于R
【无标题】
2022G3 Boiler Water Treatment Exam Mock 100 Questions and Mock Exam
webrtc学习--一对一通话
元宇宙 | 你能通过图灵测试吗?
深度学习之-01
How cursors work in Pulsar
60行从零开始自己动手写FutureTask是什么体验?
WAN技术-1广域网接口
Ueditor editor arbitrary file upload vulnerability
EasyGBS connects to mysql database and prompts "can't connect to mysql server", how to solve it?
webrtc学习--websocket服务器(二) (web端播放h264)
解决“File has been changed outside the editor, reload?”提示
JS获取简单当前时间的年、月、日、时间等
LeetCode·124.二叉树中的最大路径和·递归