Last active
June 1, 2019 05:50
-
-
Save singhrahuldps/a49a64fadff553ba34fec8d0b71cc2da 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
| # Making life easier with fast.ai | |
| # required library -> fastai (https://github.com/fastai/fastai/) | |
| from fastai.collab import * | |
| from fastai.tabular import * | |
| # loading the dataframe | |
| ratings = pd.read_csv('ratings.csv') | |
| # creating data object | |
| data = CollabDataBunch.from_df(ratings, seed=42, valid_pct=0.1) | |
| # creating a learner object used for training and testing | |
| learn = collab_learner(data, n_factors=40, y_range=[0,11]) | |
| # training method using the 1Cycle training policy (https://sgugger.github.io/the-1cycle-policy.html) | |
| learn.fit_one_cycle(5, 5e-3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment