Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Implementations store item-item preference diffs for a It actually does a bit more for this implementation, like listing all items that may be considered for recommendation, in order to maximize what implementations can do to optimize the slope-one algorithm.

public interface DiffStorage extends Refreshable {


Returns: encapsulating the average difference in preferences between items corresponding to itemID1 and itemID2, in that direction; that is, it's the average of item 2's preferences minus item 1's preferences
  RunningAverage getDiff(long itemID1long itemID2throws TasteException;


userID user ID to get diffs for
itemID itemID to assess
prefs user's preferendces
Returns: for that user's item-item diffs
  RunningAverage[] getDiffs(long userIDlong itemIDPreferenceArray prefsthrows TasteException;


Returns: encapsulating the average preference for the given item
  RunningAverage getAverageItemPref(long itemIDthrows TasteException;


Updates internal data structures to reflect an update in a preference value for an item.

itemID item to update preference value for
prefDelta amount by which preference value changed (or its old value, if being removed
remove if true, operation reflects a removal rather than change of preference
  void updateItemPref(long itemIDfloat prefDeltaboolean removethrows TasteException;


item IDs that may possibly be recommended to the given user, which may not be all items since the item-item diff matrix may be sparse
New to GrepCode? Check out our FAQ X