1 parent 49cd46a commit 6d1e009Copy full SHA for 6d1e009
1 file changed
machine_learning/decision_tree.py
@@ -24,13 +24,13 @@ def mean_squared_error(self, labels, prediction):
24
estimate the labels
25
>>> tester = DecisionTree()
26
>>> test_labels = np.array([1,2,3,4,5,6,7,8,9,10])
27
- >>> test_prediction = np.float(6)
+ >>> test_prediction = float(6)
28
>>> tester.mean_squared_error(test_labels, test_prediction) == (
29
... TestDecisionTree.helper_mean_squared_error_test(test_labels,
30
... test_prediction))
31
True
32
>>> test_labels = np.array([1,2,3])
33
- >>> test_prediction = np.float(2)
+ >>> test_prediction = float(2)
34
35
36
@@ -145,11 +145,11 @@ def helper_mean_squared_error_test(labels, prediction):
145
@param prediction: a floating point value
146
return value: helper_mean_squared_error_test calculates the mean squared error
147
"""
148
- squared_error_sum = np.float(0)
+ squared_error_sum = float(0)
149
for label in labels:
150
squared_error_sum += (label - prediction) ** 2
151
152
- return np.float(squared_error_sum / labels.size)
+ return float(squared_error_sum / labels.size)
153
154
155
def main():
0 commit comments