From 4b2dc5d819d4ed8f58da877657fbb78773b5397a Mon Sep 17 00:00:00 2001 From: Neha-119 <70510537+Neha-119@users.noreply.github.com> Date: Thu, 1 Oct 2020 00:05:53 +0530 Subject: [PATCH] Update cost function code --- cost function code | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cost function code b/cost function code index b931a7e..ad51f4a 100644 --- a/cost function code +++ b/cost function code @@ -1,3 +1,4 @@ +#import import csv import math import numpy as np @@ -9,7 +10,7 @@ import csv - +#cost funtion def compute_cost(X, y, theta): J = 0 A = np.subtract(np.dot(X, theta), y) @@ -18,7 +19,7 @@ import csv - +#gradient descent def gradient_descent(X, y, theta, alpha, epsilon, flag): J_hist = [] all_thetas0 = [] @@ -55,7 +56,7 @@ import csv - +#main def main(x_training, y_training): x_training = x_training.T y_training = y_training.T