Created
          July 13, 2020 18:33 
        
      - 
      
 - 
        
Save dvgodoy/df2414bb21640f1133c9b99adb71c952 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Shuffles the indices | |
| idx = np.arange(N) | |
| np.random.shuffle(idx) | |
| # Uses first 80 random indices for train | |
| train_idx = idx[:int(N*.8)] | |
| # Uses the remaining indices for validation | |
| val_idx = idx[int(N*.8):] | |
| # Generates train and validation sets | |
| x_train, y_train = x[train_idx], y[train_idx] | |
| x_val, y_val = x[val_idx], y[val_idx] | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment