Skip to content

Chapter 8 - Movie Review Example - critical bug #5

Description

@Vodyanoy17

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions