Skip to content

Commit

Permalink
minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iemre committed Dec 28, 2015
1 parent 900b6d0 commit 27ee9fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 5 additions & 2 deletions AbstractExperiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ function setupSizes(obj)
hit = 0;
fprintf('Iteration %d\n', i);
topNList = obj.generateTopNListForTestSetForUser(n, userIndex);
if isempty(topNList)
continue;
end
obj.result.increaseItemHitsInList(topNList);
i = i + 1;

Expand Down Expand Up @@ -127,7 +130,7 @@ function setupSizes(obj)

function time = timeOnePrediction(obj, userIndex, itemIndex)
tic;
obj.calculateFullPrediction(userIndex, itemIndex);
obj.makePrediction(userIndex, itemIndex);
time = toc;
end

Expand Down Expand Up @@ -181,7 +184,7 @@ function setupSizes(obj)
end

cpp = totalCpp / countUser;
obj.result.CPP = cpp;
obj.result.cppRate = cpp;
disp(obj.result);
end

Expand Down
4 changes: 0 additions & 4 deletions KNN/ItemBasedKNN.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,6 @@
end

function obj = calculateSimilaritiesUsingMatlabKNN(obj)
if isempty(obj.similarities) == 0
return;
end

for itemIndex = 1:obj.itemCount
fprintf('Calculating similar items to item %d\n', itemIndex);
[neighbourIndexes, distances] = knnsearch(obj.baseSet', obj.baseSet(:, itemIndex)', 'distance', 'correlation', 'k', obj.itemCount);
Expand Down
2 changes: 1 addition & 1 deletion SparseCoding/ItemBasedSparseCoderExperiment.m
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ function initialize(obj)

ratings = obj.reconstruction(userIndex, :);
[~, topList] = sort(ratings, 'descend');
topNList = zeros(1, n);
topNList = [];
k = 1;
for itemIndex = topList
if UIMatrixUtils.userHasRatedItem(obj.baseSet,userIndex,itemIndex,obj.nilElement)
Expand Down

0 comments on commit 27ee9fa

Please sign in to comment.