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

It seems to have some problem with shuffle function in balance.py #18

Closed
fevemania opened this issue Apr 28, 2017 · 1 comment
Closed

Comments

@fevemania
Copy link

fevemania commented Apr 28, 2017

There is the simple 2000 data (no shuffle) with 1682 forwards, 161 lefts, 157 rights

But after using shuffle in build-in random library, It comes out with unpredictable result. (and I already test for more than 5 times, every time with different result.)

_2017_04_28_17_47_20_127

so I try to use shuffle method in numpy library. And the result is always correct.

_2017_04_28_17_48_32_618

@Sentdex Would you mind for testing it, Thx.

@Sentdex
Copy link
Owner

Sentdex commented May 1, 2017

Yeah, I came across this, I honestly have no idea what is happening there, makes no sense to me why that'd be happening. The way I "solved" it was to put the data into a pandas dataframe, and shuffle that. Doing that gives the results one would expect.

A few models were trained by me on the old method and it still appears to work, and I looked into the data itself and it appeared correct, but the behavior of the counts still baffles me.

Here's the code I have been using to do the shuffling:

        train_data = np.load('training_data-{}.npy'.format(i))
        df = pd.DataFrame(train_data)
        df = df.iloc[np.random.permutation(len(df))]

I will soon be updating the repo as well with these changes.

@Sentdex Sentdex closed this as completed May 10, 2017
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