Skip to content

Commit a3af892

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
fixup! Format Python code with psf/black push
1 parent 066e816 commit a3af892

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

Diff for: machine_learning/gradient_boosting_regressor.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
predict house price.
44
"""
55

6-
import pandas as pd
76
import matplotlib.pyplot as plt
7+
import pandas as pd
88
from sklearn.datasets import load_boston
9-
from sklearn.metrics import mean_squared_error, r2_score
109
from sklearn.ensemble import GradientBoostingRegressor
10+
from sklearn.metrics import mean_squared_error, r2_score
1111
from sklearn.model_selection import train_test_split
1212

1313

@@ -42,10 +42,7 @@ def main():
4242
training_score = model.score(X_train, y_train).round(3)
4343
test_score = model.score(X_test, y_test).round(3)
4444
print("Training score of GradientBoosting is :", training_score)
45-
print(
46-
"The test score of GradientBoosting is :",
47-
test_score
48-
)
45+
print("The test score of GradientBoosting is :", test_score)
4946
# Let us evaluation the model by finding the errors
5047
y_pred = model.predict(X_test)
5148

@@ -57,8 +54,7 @@ def main():
5754
# So let's run the model against the test data
5855
fig, ax = plt.subplots()
5956
ax.scatter(y_test, y_pred, edgecolors=(0, 0, 0))
60-
ax.plot([y_test.min(), y_test.max()],
61-
[y_test.min(), y_test.max()], "k--", lw=4)
57+
ax.plot([y_test.min(), y_test.max()], [y_test.min(), y_test.max()], "k--", lw=4)
6258
ax.set_xlabel("Actual")
6359
ax.set_ylabel("Predicted")
6460
ax.set_title("Truth vs Predicted")

0 commit comments

Comments
 (0)