Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allRMSE is null #11

Open
shashwatsahay opened this issue Aug 13, 2018 · 1 comment
Open

allRMSE is null #11

shashwatsahay opened this issue Aug 13, 2018 · 1 comment

Comments

@shashwatsahay
Copy link
Collaborator

shashwatsahay commented Aug 13, 2018

Upon passing the command

MeDeCom:::plot.K.selection(medecom.result, statistic = "maeA", Ks = as.numeric(c(2,3,4,5)),lambdas = c(0e+00, 1e-04, 1e-03, 1e-02), cg_subset = 1, sample_subset = NULL,cg_subsets = c(1),, KvsRMSElambdaLegend = TRUE)

error is thrown at line 632 that allRMSE is null which should not possible because at line 631
if(is.null(dim(allRMSE)) condition is checked which should be if(!is.null(dim(allRMSE))

Also just for easy readability allRMSE should be defined for each type of statistics that could be plotted with plot.K.Selection.

Secondly on thorough examination it is found that mae does not exist as a stat in the getstatisitc
setMethod("getStatistics", signature(object="MeDeComSet"),
function(object, Ks=object@parameters$Ks, lambdas=object@parameters$lambdas, cg_subset=1, statistic="cve"){
check_inputs(object, cg_subset, Ks, lambda=lambdas)
elt<-c(
"objective"="Fval", "Fval"="Fval",
"rmse"="rmse", "RMSE"="rmse",
"CVE"="cve", "cve"="cve"
)[statistic]
return(object@outputs[[cg_subset]][[elt]][match(Ks, object@parameters$Ks), match(lambdas, object@parameters$lambdas)])
})

owing to null return hence could be that the if condition checks for the null return and tries to initalise it as an empty matrix in which case instead of

allRMSE<-matrix(allRMSE, nrow=length(Ks), ncol=length(lambdas))

at line 631 of plotting.R allRMSE should be defined as

allRMSE<-matrix(, nrow=length(Ks), ncol=length(lambdas))

@shashwatsahay
Copy link
Collaborator Author

same is the case for dist2c that is the MDC option of factorViz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant