Comments (2)
this is my input data it may help you incase my input is not standard so the function cannot understand it
if this is the case please tell me the solution
from surprise.
1- reader = Reader(rating_scale=(1, 5)) 2- data = Dataset.load_from_df(ratings[['userId', 'asin', 'rating']], reader) # this is my own dataset 3 - svd = SVD(n_factors= 30 , n_epochs= 20 , lr_all = 0.005 , reg_all = 0.02 ) 4 - real_trainset = data.build_full_trainset() 5 - svd.fit(real_trainset) 6 -real_testset = real_trainset.build_anti_testset() # the code stop here after along time and at the end it returns memory error 7 -predictions = svd.test(real_testset) 8 - top_n = get_top_n(predictions, n=20)
When I run the program it stops at line number 6 because of (build_anti_testset()) and it returns memory error after along time
however when I replace (build_anti_testset()) with (build_testset()) it works and doesnot have any problem
but I need to use (build_anti_testset()) instead of (build_testset()) because I need the predictions to be on the items that the users has not rated yet
Dear @bodymostafa123
those two functions use very different amounts of memory.
build_testset() function transforms the trainset into a somehow raw format. If your trainset has x lines of ratings, resulted test set also has x lines of ratings.
build_anti_testset() uses much more memory. consider there are n users and m items, this function has (n * m) - x lines of ratings. HTH.
from surprise.
Related Issues (20)
- question - surprise for implicit rating data? HOT 1
- Can Surprise work with PySpark?
- What to do if the dataset I want to read has more than three parameters HOT 1
- A bug when importing data from DataFrame HOT 2
- How do I apply ALS minimization in SVD? HOT 1
- Error: Sample larger than population or is negative? HOT 1
- Issues with running Suprise on M1 mac HOT 1
- trainset do not recommend new products
- Cross-validation kNN wrong results on custom dataset
- Possible memory leakage in SVDpp HOT 1
- GridSearchCV always recommends the first parameter combination as best HOT 2
- Wrong mapping of the raw IDs to the internal IDs
- How to remove NumPy installation in setup.py HOT 5
- Couldn't install Surprise in windows HOT 6
- No timestamp data in trainset HOT 1
- Couldn't install Surprise HOT 6
- How to do kfold crossvalidation on trainset (eg splitting movielens-100k using u1 split. then kfold crossvalidation on u1.base, test on u1.test) HOT 1
- Unexpected RMSE Differences in SVD Models with almost the same Training Data
- Compatibility with Python 3.12 HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surprise.