class ItemBasedRecommender extends Recommender
The ItemBasedRecommender
class is used to perform predictions based on
Item based Collaborative Filtering techniques (Cosine, Correlation, Adjusted Cosine)
- Alphabetic
- By Inheritance
- ItemBasedRecommender
- Recommender
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ItemBasedRecommender(input: MatrixI, m: Int, n: Int, stream: Int = 0)
- input
the original 4-column input data matrix
- m
the number of rows
- n
the number of columns
- stream
the random number stream to use
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
adjCosine: Unit
Generate the Adjusted Cosine Similarity matrix.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
corrSim: Unit
Generate the Correlation Similarity matrix.
-
def
cosSim: Unit
Generate the Cosine Similarity matrix on the basis of column - corated pairs.
-
def
crossValidate(tester: MatrixD): Unit
Phase 2: Cross validate the final predictions against the test dataset.
Phase 2: Cross validate the final predictions against the test dataset.
- tester
testing data matrix
- Definition Classes
- Recommender
-
def
denormalize(i: Int): Double
Create a column denormalized version of 'this' matrix.
Create a column denormalized version of 'this' matrix. return the denormalized value of the
- i
the user index
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error_metrics(input: MatrixI): Unit
Phase 1: Print MAE and RMSE metrics based on the final predictions for the test dataset.
Phase 1: Print MAE and RMSE metrics based on the final predictions for the test dataset.
- input
the test portion of the original 4-column input matrix
- Definition Classes
- Recommender
-
def
genTrain2(train: MatrixI): Unit
Generate the training matrix for the dataset for Phase 1.
Generate the training matrix for the dataset for Phase 1.
- train
the training data matrix
-
def
genTrainTest(exl: VectorI, input: MatrixI): MatrixD
Generate the training matrix for the dataset for Phase 2.
Generate the training matrix for the dataset for Phase 2.
- exl
the vector of index values which will be excluded in the train
- input
the original data matrix
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
getStats: Array[Statistic]
Return the variables for the statistics vectors.
Return the variables for the statistics vectors.
- Definition Classes
- Recommender
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
impute: Unit
Impute values for null/zero values in the 'training' matrix using Column Mean Imputation.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
makeRatings(input: MatrixI, m: Int, n: Int): MatrixD
Convert an original 4-column 'input' integer matrix (i, j, value, timestamp) into a two-dimensional 'ratings' double matrix with 'm' rows and 'n' columns.
Convert an original 4-column 'input' integer matrix (i, j, value, timestamp) into a two-dimensional 'ratings' double matrix with 'm' rows and 'n' columns. The 'input' matrix has type
MatrixI
, while the 'ratings' matrix has typeMatrixD
.- input
the original 4-column input data matrix containing ratings, e.g., from a file
- m
the number of rows for the ratings matrix
- n
the number of columns for the ratings matrix
- Definition Classes
- Recommender
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
normalize: Unit
Normalize the 'training' matrix by subtracting the row mean from each non-zero element.
Normalize the 'training' matrix by subtracting the row mean from each non-zero element. Row mean calculations exclude the zero elements.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
rate(i: Int, j: Int): Double
Generate a rating based on the similarity between 'nsim' similar items.
Generate a rating based on the similarity between 'nsim' similar items.
- i
the user index
- j
the item index
- Definition Classes
- ItemBasedRecommender → Recommender
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
test(istart: Int, iend: Int, input: MatrixI): Unit
Phase 3: Test the accuracy of the predictions and add it to the statistics vector.
Phase 3: Test the accuracy of the predictions and add it to the statistics vector.
- istart
the start point
- iend
the end point
- input
the original 4-column input matrix
- Definition Classes
- Recommender
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
topk(x: VectorD, k: Int): VectorI
Return the indices of the 'k' largest values in vector 'x'.
Return the indices of the 'k' largest values in vector 'x'. FIX - replace with more efficient top-k algorithm
- x
the input vector
- k
the number of values to be returned
- Definition Classes
- Recommender
-
def
topk2(x: VectorD, k: Int): Array[Int]
Return the indices of the 'k' largest values in vector 'x'.
Return the indices of the 'k' largest values in vector 'x'.
- x
the input vector
- k
the number of values to be returned
- Definition Classes
- Recommender
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
zRatings(limit: Int, input: MatrixI): Unit
Return a matrix with replacing all values with 0 beyond the interval specified corresponds to Phase 3 of the expermiments.
Return a matrix with replacing all values with 0 beyond the interval specified corresponds to Phase 3 of the expermiments.
- limit
the interval start point
- input
the original data matrix
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated