Created
          July 12, 2020 23:18 
        
      - 
      
 - 
        
Save neelriyer/d2634ec5dd5af5952520b1eaadfcface to your computer and use it in GitHub Desktop.  
    Collab filtering create collab learner using fastai
  
        
  
    
      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
    
  
  
    
  | user_name = 'userId' | |
| item_name = 'movieId' | |
| rating_name = 'rating' | |
| cols = [user_name, item_name, rating_name] | |
| data = (CollabDataBunch.from_df( | |
| ratings[cols], | |
| user_name=user_name, | |
| item_name=item_name, | |
| rating_name=rating_name, | |
| seed = 42, | |
| valid_pct = 0.2, | |
| bs=2**11)) # up the batch size | |
| y_range = ((ratings[rating_name].min(), | |
| ratings[rating_name].max()+0.5)) | |
| learn = collab_learner(data, n_factors=50, y_range=y_range) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment