Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 8 - Movie Review Example - critical bug #5

Open
Vodyanoy17 opened this issue Jun 1, 2020 · 0 comments
Open

Chapter 8 - Movie Review Example - critical bug #5

Vodyanoy17 opened this issue Jun 1, 2020 · 0 comments

Comments

@Vodyanoy17
Copy link

instead of

# Holdout split
split = 0.7
d_train = d[:int(split*len(d))]
d_test = d[int((1-split)*len(d)):]

shoud be the fiollowing code

# Holdout split
split = 0.7
d = list(range(1, 10))
d_train = d[:int(split*len(d))]
d_test = d[int((split)*len(d)):]

it breaks all the models in this part of book, the modes are overfitted
Here is the simple example

# Holdout split
split = 0.7
d = list(range(1, 10))
d_train = d[:int(split*len(d))]
d_test = d[int((1-split)*len(d)):]
print(d_train)
print(d_test)

[1, 2, 3, 4, 5, 6]
[3, 4, 5, 6, 7, 8, 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant