Skip to content

Commit 2d07bfd

Browse files
A-MahlaAmir Mahla
andauthored
change: docstring in module00 (#253)
Co-authored-by: Amir Mahla <ammah@MBP-de-Amir-2.lan>
1 parent e669a8d commit 2d07bfd

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

module05/en.subject.tex

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -612,10 +612,10 @@ \section*{Instructions}
612612
def simple_predict(x, theta):
613613
"""Computes the vector of prediction y_hat from two non-empty numpy.ndarray.
614614
Args:
615-
x: has to be an numpy.ndarray, a one-dimensional vector of size m.
616-
theta: has to be an numpy.ndarray, a one-dimensional vector of size 2.
615+
x: has to be an numpy.ndarray, a one-dimensional array of size m.
616+
theta: has to be an numpy.ndarray, a one-dimensional array of size 2.
617617
Returns:
618-
y_hat as a numpy.ndarray, a one-dimensional vector of size m.
618+
y_hat as a numpy.ndarray, a one-dimensional array of size m.
619619
None if x or theta are empty numpy.ndarray.
620620
None if x or theta dimensions are not appropriate.
621621
Raises:
@@ -694,7 +694,7 @@ \section*{Instructions}
694694
def add_intercept(x):
695695
"""Adds a column of 1's to the non-empty numpy.array x.
696696
Args:
697-
x: has to be a numpy.array. x can be a one-dimensional (m * 1) or two-dimensional (m * n) vector.
697+
x: has to be a numpy.array. x can be a one-dimensional (m * 1) or two-dimensional (m * n) array.
698698
Returns:
699699
X, a numpy.array of dimension m * (n + 1).
700700
None if x is not a numpy.array.
@@ -811,10 +811,10 @@ \section*{Instructions}
811811
def predict_(x, theta):
812812
"""Computes the vector of prediction y_hat from two non-empty numpy.array.
813813
Args:
814-
x: has to be an numpy.array, a one-dimensional vector of size m.
815-
theta: has to be an numpy.array, a two-dimensional vector of shape 2 * 1.
814+
x: has to be an numpy.array, a one-dimensional array of size m.
815+
theta: has to be an numpy.array, a two-dimensional array of shape 2 * 1.
816816
Returns:
817-
y_hat as a numpy.array, a two-dimensional vector of shape m * 1.
817+
y_hat as a numpy.array, a two-dimensional array of shape m * 1.
818818
None if x and/or theta are not numpy.array.
819819
None if x or theta are empty numpy.array.
820820
None if x or theta dimensions are not appropriate.
@@ -895,9 +895,9 @@ \section*{Instructions}
895895
def plot(x, y, theta):
896896
"""Plot the data and prediction line from three non-empty numpy.array.
897897
Args:
898-
x: has to be an numpy.array, a one-dimensional vector of size m.
899-
y: has to be an numpy.array, a one-dimensional vector of size m.
900-
theta: has to be an numpy.array, a two-dimensional vector of shape 2 * 1.
898+
x: has to be an numpy.array, a one-dimensional array of size m.
899+
y: has to be an numpy.array, a one-dimensional array of size m.
900+
theta: has to be an numpy.array, a two-dimensional array of shape 2 * 1.
901901
Returns:
902902
Nothing.
903903
Raises:
@@ -1011,10 +1011,10 @@ \section*{Instructions}
10111011
Description:
10121012
Calculates all the elements (y_pred - y)^2 of the loss function.
10131013
Args:
1014-
y: has to be an numpy.array, a two-dimensional vector of shape m * 1.
1015-
y_hat: has to be an numpy.array, a two-dimensional vector of shape m * 1.
1014+
y: has to be an numpy.array, a two-dimensional array of shape m * 1.
1015+
y_hat: has to be an numpy.array, a two-dimensional array of shape m * 1.
10161016
Returns:
1017-
J_elem: numpy.array, a vector of dimension (number of the training examples,1).
1017+
J_elem: numpy.array, a array of dimension (number of the training examples, 1).
10181018
None if there is a dimension matching problem.
10191019
None if any argument is not of the expected type.
10201020
Raises:
@@ -1027,8 +1027,8 @@ \section*{Instructions}
10271027
Description:
10281028
Calculates the value of loss function.
10291029
Args:
1030-
y: has to be an numpy.array, a two-dimensional vector of shape m * 1.
1031-
y_hat: has to be an numpy.array, a two-dimensional vector of shape m * 1.
1030+
y: has to be an numpy.array, a two-dimensional array of shape m * 1.
1031+
y_hat: has to be an numpy.array, a two-dimensional array of shape m * 1.
10321032
Returns:
10331033
J_value : has to be a float.
10341034
None if there is a dimension matching problem.
@@ -1141,8 +1141,8 @@ \section*{Instructions}
11411141
"""Computes the half mean squared error of two non-empty numpy.array, without any for loop.
11421142
The two arrays must have the same dimensions.
11431143
Args:
1144-
y: has to be an numpy.array, a one-dimensional vector of size m.
1145-
y_hat: has to be an numpy.array, a one-dimensional vector of size m.
1144+
y: has to be an numpy.array, a one-dimensional array of size m.
1145+
y_hat: has to be an numpy.array, a one-dimensional array of size m.
11461146
Returns:
11471147
The half mean squared error of the two vectors as a float.
11481148
None if y or y_hat are empty numpy.array.
@@ -1334,7 +1334,7 @@ \section*{Instructions}
13341334
Description:
13351335
Calculate the MSE between the predicted output and the real output.
13361336
Args:
1337-
y: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1337+
y: has to be a numpy.array, a two-dimensional array of shape m * 1.
13381338
y_hat: has to be a numpy.array, a two-dimensional vector of shape m * 1.
13391339
Returns:
13401340
mse: has to be a float.
@@ -1350,8 +1350,8 @@ \section*{Instructions}
13501350
Description:
13511351
Calculate the RMSE between the predicted output and the real output.
13521352
Args:
1353-
y: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1354-
y_hat: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1353+
y: has to be a numpy.array, a two-dimensional array of shape m * 1.
1354+
y_hat: has to be a numpy.array, a two-dimensional array of shape m * 1.
13551355
Returns:
13561356
rmse: has to be a float.
13571357
None if there is a matching dimension problem.
@@ -1366,8 +1366,8 @@ \section*{Instructions}
13661366
Description:
13671367
Calculate the MAE between the predicted output and the real output.
13681368
Args:
1369-
y: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1370-
y_hat: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1369+
y: has to be a numpy.array, a two-dimensional array of shape m * 1.
1370+
y_hat: has to be a numpy.array, a two-dimensional array of shape m * 1.
13711371
Returns:
13721372
mae: has to be a float.
13731373
None if there is a matching dimension problem.
@@ -1382,8 +1382,8 @@ \section*{Instructions}
13821382
Description:
13831383
Calculate the R2score between the predicted output and the output.
13841384
Args:
1385-
y: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1386-
y_hat: has to be a numpy.array, a two-dimensional vector of shape m * 1.
1385+
y: has to be a numpy.array, a two-dimensional array of shape m * 1.
1386+
y_hat: has to be a numpy.array, a two-dimensional array of shape m * 1.
13871387
Returns:
13881388
r2score: has to be a float.
13891389
None if there is a matching dimension problem.

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v5.0.2
1+
v5.0.2.post1

0 commit comments

Comments
 (0)