Skip to content

Travis CI: Test on Python 3.9 release candidate 2 #2488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
os: linux
dist: focal
addons: # TEMPORARY: Just for Python 3.9-rc2
apt:
update: true
packages:
- python3-keras
- python3-pandas
- python3-sklearn
language: python
python: 3.8
python: 3.9-dev
cache: pip
before_install: pip install --upgrade pip setuptools six
install: pip install black flake8
Expand Down
1 change: 1 addition & 0 deletions DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@
* [Data Transformations](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/data_transformations.py)
* [Decision Tree](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/decision_tree.py)
* [Gaussian Naive Bayes](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/gaussian_naive_bayes.py)
* [Gradient Boosting Regressor](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/gradient_boosting_regressor.py)
* [Gradient Descent](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/gradient_descent.py)
* [K Means Clust](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/k_means_clust.py)
* [K Nearest Neighbours](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/k_nearest_neighbours.py)
Expand Down
12 changes: 4 additions & 8 deletions machine_learning/gradient_boosting_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
predict house price.
"""

import pandas as pd
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import load_boston
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.metrics import mean_squared_error, r2_score
from sklearn.model_selection import train_test_split


Expand Down Expand Up @@ -42,10 +42,7 @@ def main():
training_score = model.score(X_train, y_train).round(3)
test_score = model.score(X_test, y_test).round(3)
print("Training score of GradientBoosting is :", training_score)
print(
"The test score of GradientBoosting is :",
test_score
)
print("The test score of GradientBoosting is :", test_score)
# Let us evaluation the model by finding the errors
y_pred = model.predict(X_test)

Expand All @@ -57,8 +54,7 @@ def main():
# So let's run the model against the test data
fig, ax = plt.subplots()
ax.scatter(y_test, y_pred, edgecolors=(0, 0, 0))
ax.plot([y_test.min(), y_test.max()],
[y_test.min(), y_test.max()], "k--", lw=4)
ax.plot([y_test.min(), y_test.max()], [y_test.min(), y_test.max()], "k--", lw=4)
ax.set_xlabel("Actual")
ax.set_ylabel("Predicted")
ax.set_title("Truth vs Predicted")
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ beautifulsoup4
black
fake_useragent
flake8
keras
keras; python_version <= '3.8'
lxml
matplotlib
mypy
numpy
opencv-python
pandas
pandas; python_version <= '3.8'
pillow
pytest
pytest-cov
requests
scikit-fuzzy
sklearn
scikit-fuzzy; python_version <= '3.8'
sklearn; python_version <= '3.8'
sympy
tensorflow
xgboost
tensorflow; python_version <= '3.8'
xgboost; python_version <= '3.8'