机器学习 -- 多元回归实现实例
来源:互联网 发布:java多线程日志输出 编辑:程序博客网 时间:2024/06/06 02:15
实现依然基于accord.net framework
1. 二维数组作为输入和一元输出数组
2. 执行回归,得到回归的方差和,以及回归方程(ax+by+c)的各个系数
实现代码
public class MultiRegressionDemo { public static void Execute() { // 2 dimensions MultipleLinearRegression target = new MultipleLinearRegression(2, true); double[][] inputs = { new double[] { 1, 8 }, new double[] { 2, 29 }, new double[] { 3, 2 }, new double[] { 0, 1 }, new double[] { 5, 6 }, new double[] { 4, 7 }, new double[] { 14, 17 }, }; double[] outputs = { 9, 4, 3, 2, 5, 12, 7 }; double error = target.Regress(inputs, outputs); Console.WriteLine("the regression error is '{0}'", error); // As result, we will be given the following: double a = target.Coefficients[0]; // a = 0 double b = target.Coefficients[1]; // b = 0 double c = target.Coefficients[2]; // c = 1 Console.WriteLine("line functions is :{0}x + {1}y + {2}", a, b, c); } }class Program { static void Main(string[] args) { MultiRegressionDemo.Execute(); Console.ReadLine(); } }
运行结果:
2 0
- 机器学习 -- 多元回归实现实例
- 7.4多元线性回归实例1--python机器学习
- 7.4多元线性回归实例1--python机器学习
- Python实现机器学习二(实现多元线性回归)
- Python实现机器学习--实现多元线性回归
- 机器学习5——多元回归及其代码实现
- 机器学习回归篇-多元线性回归
- 多元线性回归 机器学习基础(1)
- 机器学习——多元线性回归
- 7.3多元线性回归--python机器学习
- 机器学习——多元线性回归
- 机器学习sklearn多元线性回归
- 机器学习sklearn多元线性回归2
- 机器学习练习二:多元线性回归
- 机器学习(多元线性回归)
- [机器学习]机器学习笔记整理14-多元回归分析及实现
- 机器学习-2 多元线性回归、多项式回归
- 机器学习算法学习二:多元线性回归
- test
- CodeForces 366A Dima and Guards(结构体,数学)
- HDU 2612 Find a way(BFS)
- NKOI 3559 子串
- Android官方MVP架构示例项目解析
- 机器学习 -- 多元回归实现实例
- C语言执行shellcode的五种方法
- 由Tomcat 8005端口想到的...
- 安卓小案例收集一
- PAT 甲级 1019 General Palindromic Number(简单题)
- IBM MQ 发送 和 接收
- jackson学习
- Ubuntu系统的安装以及基本软件的安装
- Activity向Fragment中传值