python-machine-learning-book-2nd-edition icon indicating copy to clipboard operation
python-machine-learning-book-2nd-edition copied to clipboard

Chapter 16 typo

Open rickiepark opened this issue 5 years ago • 1 comments

(p546) In a note, "Since the loss at time 1:t is dependent on the hidden units at all previous time steps 1:t" may be "Since the loss at time t is dependent on the hidden units at all previous time steps 1:t-1".

(p555) In middle code block,

>>> X_train = sequences[:25000,:]
>>> y_train = df.loc[:25000, 'sentiment'].values
>>> X_test = sequences[25000:,:]
>>> y_test = df.loc[25000:, 'sentiment'].values

As you may know, pandas' dataframe slicing includes start and end index. Actually it is not a problem with this example, but I think it's better to change y_train = df.loc[:24999, 'sentiment'].values.

Thanks.

rickiepark avatar Feb 27 '19 08:02 rickiepark

Thank you @rickiepark for your comments. You are right on both statements, it should be « at time t » and the last index should be 2499. We will make a note of these for the next release.

vmirly avatar Apr 20 '19 13:04 vmirly