| | |
| | | using IStation.Curve; |
| | | using MathNet.Numerics.LinearAlgebra; |
| | | using MathNet.Numerics.LinearAlgebra.Double; |
| | | using System.Formats.Asn1; |
| | | using System.IO; |
| | | using System.Text; |
| | | using Yw.Untity; |
| | |
| | | var pX = double.Parse(xStr); |
| | | var pY = double.Parse(yStr); |
| | | |
| | | pY = Math.Abs(pY); |
| | | ptList.Add(new CurvePoint(pX, pY)); |
| | | |
| | | } |
| | |
| | | var y = ptList.Select(x => x.Y).ToArray(); |
| | | |
| | | // 多项式回归的阶数(例如,二次多项式) |
| | | int degree = 8; |
| | | int degree = 10; |
| | | |
| | | // 拟合多项式回归模型 |
| | | double[] coefficients = NonlinearRegressionHelper.FitPolynomial(x, y, degree); |
| | |
| | | double xNew = target_pressure2; |
| | | double yPredicted = NonlinearRegressionHelper.PredictPolynomial(xNew, coefficients); |
| | | |
| | | target_flow2 -= yPredicted; |
| | | target_flow2 += yPredicted; |
| | | AlertTool.ShowInfo(this,"预测缺失",$"{yPredicted}"); |
| | | |
| | | // 计算 R² 和 MSE |