nfmcclure / tensorflow_cookbook

Code for Tensorflow Machine Learning Cookbook

Home Page:https://www.packtpub.com/big-data-and-business-intelligence/tensorflow-machine-learning-cookbook-second-edition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

06_NeuralNetwork_07_ImprovedRegression: Error in y_vals and x_vals indexing

ychong opened this issue · comments

Hi,

I believe for 06_NeuralNetwork_07_ImprovedLinearRegression, the x_vals and y_vals are indexed incorrectly.

y_vals should be indexed as x[0] , and x_vals as x[1:8].

Here is a suggested correction:

y_vals = np.array([x[0] for x in birth_data])
x_vals = np.array([x[1:9] for x in birth_data])

For your further action. Thank you.

Sincerely,
Yi Xiang
chongyixiang@gmail.com

commented

Thanks! I'll look into this in the next few months for the upcoming v2 of the book/code.

commented

This should be fixed now, thanks!