remove the dependence of matplotlib in dataset of uci_housing

remove the dependence of matplotlib  in dataset of uci_housing
numel
wawltor 6 years ago committed by GitHub
parent f0b26313d8
commit 24ec5175ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save