python-machine-learning-book-2nd-edition
python-machine-learning-book-2nd-edition copied to clipboard
Chapter 16 typo
(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.
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.