当前位置:网站首页>Data interpolation -- normalize data of different magnitude
Data interpolation -- normalize data of different magnitude
2022-07-28 21:52:00 【Frost Creek】
In some cases , Normalization can improve the interpolation results , But in other cases, it may affect the accuracy of the solution . Whether to use normalization needs to be judged according to the nature of interpolation data .
advantage : Normalized data may improve the interpolation results when the independent variables have different units and different scales . under these circumstances , Scaling the input to a similar magnitude can improve the numerical shape of interpolation .
Be careful : If each variable has the same unit , Be careful when normalizing the data , Even if the scale of each variable is different . For data of the same unit , Normalization will affect the basic triangulation and eventually reduce the accuracy of interpolation due to adding direction deviation , So that the solution is distorted . for example , If x and y Both represent positions and are represented by “ rice ” In units of , Then normalization is wrong . At this time, it is not recommended to x and y Make inconsistent scaling , Because Zhengdong 10 Meter and true north 10 Meters are the same in space distance .

Create some sample data , among y The value ratio in x The value in is several orders of magnitude larger . hypothesis x and y Have different units .
x = rand(1,1000)/100;
y = 2.*(rand(1,1000)-0.5).*90;
z = x.^2;
Use the above sample data to build a grid data , Interpolate based on the sample data on the grid and draw the results .
x1 = linspace(min(x),max(x),25);
y1= linspace(min(y),max(y),25);
[X, Y] = meshgrid(x1,y1);
Z = griddata(x,y,z,X,Y);
plot3(x,y,z,'co')
hold on
mesh(X,Y,Z)

griddata The result is not very smooth , There seems to be noisy data . This is because the independent variables have different scales , Because a small change in the size of one variable will lead to a huge change in the size of another variable .
because x and y Have different units , Normalize them to a similar order , It should help produce better results . Normalize the sample points , And use griddata Regenerate interpolation .
% Normalized data
x = mapminmax(x);
y = mapminmax(y);
% Generating grid data
x1 = linspace(min(x),max(x),25);
y1 = linspace(min(y),max(y),25);
[X,Y] = meshgrid(x1,y1);
% Data interpolation
Z= griddata(x,y,z,X,Y);
plot3(x,y,z,'co')
hold on
mesh(X,Y,Z)

under these circumstances , Normalizing the sample points will make griddata Calculate a smoother solution .
This shows that when the data magnitude varies greatly , Direct interpolation is not a very wise choice , Try to process the data , This is an important skill .
The articles
边栏推荐
- 八、QOS队列调度与报文丢弃
- Pytoch learning record (III): random gradient descent, neural network and full connection
- What is the purpose of database read-write separation [easy to understand]
- Adventures of little mouse: behind the scenes gags of moss 2
- 30. Learn highcharts label rotation histogram
- 1945. sum of digits after string conversion
- Four methods of multi-threaded sequential operation. Ask casually during the interview
- C语言入门【详细】
- [英雄星球七月集训LeetCode解题日报] 第28日 动态规划
- Construction of Chinese traditional embroidery classification model based on xception TD
猜你喜欢

【Bluetooth蓝牙开发】八、BLE协议之传输层

基于对象的实时空间音频渲染丨Dev for Dev 专栏

Log slimming operation: how to optimize from 5g to 1g! (glory Collection Edition)

Pytoch learning record (III): random gradient descent, neural network and full connection

物联网技术栈之网关技术

Edited by vimtutor

分而治之,大型文件分片上传

Why on earth is it not recommended to use select *?

基于BRNN的政务APP评论端到端方面级情感分析方法

LT7911D Type-C/DP转mipi 方案成熟可提供技术支持
随机推荐
Chinese patent keyword extraction based on LSTM and logistic regression
World Hepatitis Day | grassroots can also enjoy the three a resources. How can the smart medical system solve the "difficulty of seeing a doctor"?
不用Swagger,那我用啥?
这种动态规划你见过吗——状态机动态规划之股票问题(下)
将字符串指针赋值给数组[通俗易懂]
C#流程控制语句
Explain C language 12 in detail (C language series)
凡尔赛天花板:“毕业两年月薪才35K,真是没出息啊~~”
Week 6 Linear Models for Classification (Part B)
What is the purpose of database read-write separation [easy to understand]
MSI Bao'an factory is on fire! Official response: no one was injured, and the production line will not be affected!
openEuler Embedded SIG | 分布式软总线
Have you ever seen this kind of dynamic programming -- the stock problem of state machine dynamic programming (Part 2)
B+ tree height calculation of MySQL
Top level "redis notes", cache avalanche + breakdown + penetration + cluster + distributed lock, Nb
[Bluetooth Bluetooth development] VIII. Transmission layer of ble protocol
With the help of domestic chip manufacturers, the shipment of white brand TWS headphones has reached 600million in 2020
First week of internship diary
How to skillfully use assertion + exception handling classes to make the code more concise! (glory Collection Edition)
面向千元级5G手机市场,联发科天玑700发布