You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
There is a mistake in the calculation of the # of columns in the ipython book.
'''n_features = len(rows[0]) - 1 # number of columns''' does define the number of samples -1, not the number of columns.
This should be replaced with:
n_features = rows.shape(1) for getting the number of columns.
The code in the example works, because of the number of the rows and columns are not way too off from each other.
The text was updated successfully, but these errors were encountered:
Hi,
I think the code is correct. rows[0] is the first row of data in the training set. We then get the length of this row which includes the headers and the last class column. And then we subtract 1 to get the number of headers only.
I tried this with my own, completely separate training set and the implementation worked fine.
Hi,
There is a mistake in the calculation of the # of columns in the ipython book.
'''n_features = len(rows[0]) - 1 # number of columns''' does define the number of samples -1, not the number of columns.
This should be replaced with:
n_features = rows.shape(1) for getting the number of columns.
The code in the example works, because of the number of the rows and columns are not way too off from each other.
The text was updated successfully, but these errors were encountered: