From a33e39ae2cd12b3e9b424db3462fd0db4338e0d5 Mon Sep 17 00:00:00 2001 From: Julien RICHARD Date: Tue, 1 Oct 2024 14:55:03 +0200 Subject: [PATCH] Refactor sum_of_square_error function in linear_regression.py --- machine_learning/linear_regression.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/machine_learning/linear_regression.py b/machine_learning/linear_regression.py index a0930dd02..6aa52709d 100644 --- a/machine_learning/linear_regression.py +++ b/machine_learning/linear_regression.py @@ -67,13 +67,6 @@ def sum_of_square_error(data_x, data_y, len_data, theta): :param len_data : len of the dataset :param theta : contains the feature vector :return : sum of square error computed from given feature's - - >>> data_x = np.array([[1, 2], [1, 3], [1, 4]]) - >>> data_y = np.array([[2], [2], [2]]) - >>> theta = np.array([[0.0, 0.0]]) - >>> len_data = len(data_x) - >>> sum_of_square_error(data_x, data_y, len_data, theta).round(2) - 2.0 """ prod = np.dot(theta, data_x.transpose()) prod -= data_y.transpose()