私はrecommenderlab
パッケージで作成したバイナリ推薦システムをテストしようとしています。 calcPredictionAccuracy
関数を実行すると、次のエラーが表示されます。テストの推奨システム:予測のために与えられたアイテムの数を指定する方法。 `calcPredictionAccuracy`関数
.local(x、data、...)のエラー: 予測に与えられたアイテムの数を指定する必要があります。 私は数多くの検索を行っており、この問題の解決策を見つけることができないようです。私は与えられた引数のエラーの変更を追加しようとした場合:ここで
error.ubcf<-calcPredictionAccuracy(p.ubcf, getData(test_index, "unknown", given=3)) Error in .local(x, ...) : unused argument (given = 3)
私のコードで簡単に見ている:
私のデータセットは、binary.watch.ratings
affinity.matrix <- as(binary.watch.ratings,"binaryRatingMatrix")
test_index <- evaluationScheme(affinity.matrix[1:1000], method="split",
train=0.9, given=1)
# creation of recommender model based on ubcf
Rec.ubcf <- Recommender(getData(test_index, "train"), "UBCF")
# creation of recommender model based on ibcf for comparison
Rec.ibcf <- Recommender(getData(test_index, "train"), "IBCF")
# making predictions on the test data set
p.ubcf <- predict(Rec.ubcf, getData(test_index, "known"), type="topNList")
# making predictions on the test data set
p.ibcf <- predict(Rec.ibcf, getData(test_index, "known"), type="topNList")
# obtaining the error metrics for both approaches and comparing them
##error occurs with the following two lines
error.ubcf<-calcPredictionAccuracy(p.ubcf, getData(test_index, "unknown"))
error.ibcf<-calcPredictionAccuracy(p.ibcf, getData(test_index, "unknown"))
error <- rbind(error.ubcf,error.ibcf)
rownames(error) <- c("UBCF","IBCF")
これです次のエラーが発生します。
error.ubcf<-calcPredictionAccuracy(p.ubcf, getData(test_index, "unknown")) Error in .local(x, data, ...) : You need to specify how many items were given for the prediction!
私のコードでは、いくつの項目が指定されなければなりませんか予測のために与えられる?この問題は私のデータがバイナリであるという事実に関連していますか?
おかげ
ロバート
ありがとうございます。それが問題を解決した – phillipsr