using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GrandientDescent
{
class Program
{
static void Main(string[] args)
{
//each element in x represents (x0,x1,x2)
Double[,] X = new Double[5, 3] { { 1, 0.0, 3 }, { 1, 1.0, 3 }, { 1, 2.0, 3 }, { 1, 3.0, 2 }, { 1, 4.0, 4 } };
//y[i] is the output of y = theta0 * x[0] + theta1 * x[1] +theta2 * x[2]+theta3
Double[] Y = new Double[5] { 95.364, 97.217205, 75.195834, 60.105519, 49.342380 };
/*
parameter::theta待求的权值
parameter::alpha学习速率
parameter::m 样本总数 此处m = 10
parameter::max_iter 最大迭代次数
*/
double epsilon = 0.000001;
Random ra
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GrandientDescent
{
class Program
{
static void Main(string[] args)
{
//each element in x represents (x0,x1,x2)
Double[,] X = new Double[5, 3] { { 1, 0.0, 3 }, { 1, 1.0, 3 }, { 1, 2.0, 3 }, { 1, 3.0, 2 }, { 1, 4.0, 4 } };
//y[i] is the output of y = theta0 * x[0] + theta1 * x[1] +theta2 * x[2]+theta3
Double[] Y = new Double[5] { 95.364, 97.217205, 75.195834, 60.105519, 49.342380 };
/*
parameter::theta待求的权值
parameter::alpha学习速率
parameter::m 样本总数 此处m = 10
parameter::max_iter 最大迭代次数
*/
double epsilon = 0.000001;
Random ra