Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 71b372f

Browse files
tianyizheng02github-actions
and
github-actions
authored
Remove doctest in xgboost_regressor.py main function (TheAlgorithms#10422)
* updating DIRECTORY.md * updating DIRECTORY.md * updating DIRECTORY.md * updating DIRECTORY.md * Update xgboost_regressor.py --------- Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent 37cae3f commit 71b372f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎machine_learning/xgboost_regressor.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ def xgboost(
3939

4040
def main() -> None:
4141
"""
42-
>>> main()
43-
Mean Absolute Error : 0.30957163379906033
44-
Mean Square Error : 0.22611560196662744
45-
4642
The URL for this algorithm
4743
https://xgboost.readthedocs.io/en/stable/
4844
California house price dataset is used to demonstrate the algorithm.
45+
46+
Expected error values:
47+
Mean Absolute Error: 0.30957163379906033
48+
Mean Square Error: 0.22611560196662744
4949
"""
5050
# Load California house price dataset
5151
california = fetch_california_housing()
@@ -55,8 +55,8 @@ def main() -> None:
5555
)
5656
predictions = xgboost(x_train, y_train, x_test)
5757
# Error printing
58-
print(f"Mean Absolute Error: {mean_absolute_error(y_test, predictions)}")
59-
print(f"Mean Square Error: {mean_squared_error(y_test, predictions)}")
58+
print(f"Mean Absolute Error: {mean_absolute_error(y_test, predictions)}")
59+
print(f"Mean Square Error: {mean_squared_error(y_test, predictions)}")
6060

6161

6262
if __name__ == "__main__":

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /