Skip to content

Commit

Permalink
remove the dependence of matplotlib in dataset of uci_housing
Browse files Browse the repository at this point in the history
remove the dependence of matplotlib  in dataset of uci_housing
  • Loading branch information
wawltor authored Sep 7, 2020
1 parent f0b2631 commit 24ec517
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/paddle/dataset/uci_housing.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def load_data(filename, feature_num=14, ratio=0.8):
data = data.reshape(data.shape[0] // feature_num, feature_num)
maximums, minimums, avgs = data.max(axis=0), data.min(axis=0), data.sum(
axis=0) / data.shape[0]
feature_range(maximums[:-1], minimums[:-1])
# if you want to print the distribution of input data, you could use function of feature_range
#feature_range(maximums[:-1], minimums[:-1])
for i in six.moves.range(feature_num - 1):
data[:, i] = (data[:, i] - avgs[i]) / (maximums[i] - minimums[i])
offset = int(data.shape[0] * ratio)
Expand Down

0 comments on commit 24ec517

Please sign in to comment.