Skip to content

Commit 6d1e009

Browse files
Remove depreciated np.float (TheAlgorithms#7394)
1 parent 49cd46a commit 6d1e009

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

machine_learning/decision_tree.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ def mean_squared_error(self, labels, prediction):
2424
estimate the labels
2525
>>> tester = DecisionTree()
2626
>>> test_labels = np.array([1,2,3,4,5,6,7,8,9,10])
27-
>>> test_prediction = np.float(6)
27+
>>> test_prediction = float(6)
2828
>>> tester.mean_squared_error(test_labels, test_prediction) == (
2929
... TestDecisionTree.helper_mean_squared_error_test(test_labels,
3030
... test_prediction))
3131
True
3232
>>> test_labels = np.array([1,2,3])
33-
>>> test_prediction = np.float(2)
33+
>>> test_prediction = float(2)
3434
>>> tester.mean_squared_error(test_labels, test_prediction) == (
3535
... TestDecisionTree.helper_mean_squared_error_test(test_labels,
3636
... test_prediction))
@@ -145,11 +145,11 @@ def helper_mean_squared_error_test(labels, prediction):
145145
@param prediction: a floating point value
146146
return value: helper_mean_squared_error_test calculates the mean squared error
147147
"""
148-
squared_error_sum = np.float(0)
148+
squared_error_sum = float(0)
149149
for label in labels:
150150
squared_error_sum += (label - prediction) ** 2
151151

152-
return np.float(squared_error_sum / labels.size)
152+
return float(squared_error_sum / labels.size)
153153

154154

155155
def main():

0 commit comments

Comments
 (0)