Packages

class SVDReg extends Error

The SVDReg class works on the principle of Gradient Descent for minimizing the error generated and L2 regularization, while predicting the missing value in the matrix. This is obtained by the dot product of 'u(i)' and 'v(j)' vectors: Dimensionality is reduced from 'n' features to 'k' factors.

predict (i, j) = u(i) dot v(j)


Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SVDReg
  2. Error
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SVDReg(a: MatrixD, k: Int)

    a

    the input m-by-n data matrix (m instances, n features/variables)

    k

    the number of factors (k <= n)

Value Members

  1. def calc_objf: Double

    Calculate the value of the objective function after the 'u' and 'v' matrices are generated.

  2. def factor: Unit

    Factor the the input matrix 'a' to obtain the 'u' and the 'v' matrices.

  3. final def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  4. def nz_sqmean: Double

    Return the square root of the non-zero mean / k of the initial rating matrix.

  5. def predict(i: Int, j: Int): Double

    Predict the value for given row and column.

    Predict the value for given row and column.

    i

    the row id

    j

    the column id

  6. def update(h: Int): Double

    Update the 'u' and 'v' matrix to minimze sum of squared error and return the mean sum of squared errors.

    Update the 'u' and 'v' matrix to minimze sum of squared error and return the mean sum of squared errors.

    h

    the current column to update