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

Quick comment on Chapter 10 #7

Open
airman604 opened this issue Jan 24, 2017 · 1 comment
Open

Quick comment on Chapter 10 #7

airman604 opened this issue Jan 24, 2017 · 1 comment

Comments

@airman604
Copy link

In Concept01_timeseries_data.ipynb in Chapter 10, I believe you can simplify and speed up the following code:

def split_data(data, percent_train=0.80):
    num_rows = len(data)
    train_data, test_data = [], []
    for idx, row in enumerate(data):
        if idx < num_rows * percent_train:
            train_data.append(row)
        else:
            test_data.append(row)
    return train_data, test_data

as follows:

def split_data(data, percent_train=0.80):
    num_rows = len(data)*percent_train
    return data[:num_rows], data[num_rows:]
@kureta
Copy link

kureta commented Mar 17, 2017

I didn't want to open an issue for this and it is related to Chapter 10. Can you please add an example that uses batch_sequences_with_states method?

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

2 participants