Comments (3)
In your screenshot, it looks like you haven't loaded the library with library(cmfrec)
. In the example code, looks like you are passing a different object at the end.
This library doesn't do multiple topN predictions btw.
from cmfrec.
Hello,
sorry for the mistake. Here you see the fixed code. But I still have an error message.
Best regards,
Daniel
library(cmfrec)
X <- as.coo.matrix(Matrix_model_4@data)
reco_split <- create.reco.train.test(
X,
users_test_fraction = 0.2,
items_test_fraction = 0.3,
min_pos_test = 2,
seed = 123
)
X_train <- reco_split$X_train ## Train data for test users
X_test <- reco_split$X_test ## Test data for test users
X_rem <- reco_split$X_rem ## Data to fit the model
users_test <- reco_split$users_test ## IDs of the test users
### Random recommendations (random latent factors)
set.seed(123)
UserFactors_random <- matrix(rnorm(nrow(X_test) * 5), nrow=5)
ItemFactors_random <- matrix(rnorm(ncol(X_test) * 5), nrow=5)
### Non-personalized recommendations
model_baseline <- cmfrec::MostPopular(as.coo.matrix(X_rem), implicit=TRUE)
item_biases <- model_baseline$matrices$item_bias
model_iALS <- CMF_implicit(as.coo.matrix(X_rem), k=16, lambda = 0.1, alpha = 0.01, niter = 16L)
pred_iALS <- predict(model_iALS, X_test)
from cmfrec.
It looks like you're trying to pass a dgRMatrix
to predict
, which is not supported (only dgTMatrix
). You can check the docs for more details. It also looks like you are using an older version of this package as I'd see a different error if I try to execute your code.
from cmfrec.
Related Issues (20)
- I tried pip install cmfrec but get this error: Command errored out with exit status 1, and ERROR: Could not build wheels for cmfrec which use PEP 517 and cannot be installed directly
- something error when install cmfrec on Linux HOT 3
- name 'n' is not defined when using CMF_implicit() HOT 1
- predict_new() for OMF: name 'glob_mean' is not defined HOT 1
- ERROR: Invalid parameter combination, for fitting OMF HOT 1
- topN function for C API HOT 2
- Fetching entire predicted dataset HOT 1
- fit() got an unexpected keyword argument 'X' HOT 4
- Implicit feedback or explicit feedback HOT 1
- Getting different scores with using predict_new and predict methods HOT 1
- Upstream prematurely closing connection on nginx when using topN method HOT 2
- Different topN results using Dataframe vs COO HOT 6
- Transforming binary feedback into confidence levels HOT 5
- R Session aborted HOT 4
- Logging loss/metrics per iteration HOT 4
- Categorical features for user_info HOT 1
- factors for cold start items HOT 5
- Error when installing cmfrec HOT 1
- Ranking metric for measuring the performance of the model with side info HOT 6
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 cmfrec.