cost {OSNMTF} | R Documentation |
Calculate the cost
Description
A function to calculate the cost of the objective function
Usage
cost(W,init_list,lambda=0.2)
Arguments
W |
The matrix to be factorized |
init_list |
A list containing the updated results in this iteration |
lambda |
A parameter to set the relative weight of the sparsity constraint |
Value
A number indicating the total cost of the objective function
Author(s)
Xiaoyao Yin
Examples
W <- simu_data_generation()
init_list <- initialization(W,k=5,l=4)
update_L_list <- update_L(W,init_list)
update_B_list <- update_B(W,update_L_list)
update_R_list <- update_R(W,update_B_list)
update_C_list <- update_C(W,update_R_list,lambda=0.2,rho=1.1)
temp_cost <- cost(W,init_list,lambda=0.2)
[Package OSNMTF version 0.1.0 Index]