Skip to content

Commit 7e2cba7

Browse files
committed
edit regressor
1 parent b5af2cf commit 7e2cba7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kerasTUT/4-regressor_example.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
np.random.seed(1337) # for reproducibility
1515
from keras.models import Sequential
1616
from keras.layers import Dense
17-
import numpy as np
1817
import matplotlib.pyplot as plt
1918

2019
# create some data
@@ -48,3 +47,9 @@
4847
print('test cost:', cost)
4948
W, b = model.layers[0].get_weights()
5049
print('Weights=', W, '\nbiases=', b)
50+
51+
# plotting the prediction
52+
Y_pred = model.predict(X_test)
53+
plt.scatter(X_test, Y_test)
54+
plt.plot(X_test, Y_pred)
55+
plt.show()

0 commit comments

Comments
 (0)