简体   繁体   中英

Problems using package 'minet' - could not find function mutinformation

When trying to run the sample code that is in the Minet paper / vignette I am experiencing a nunber of issues, eg

mim <- build.mim(discretize(syn.data), estimator)

Error in build.mim(dataset, estimator, disc, nbins):
    could not find function "mutinformation"

I have also received other errors such as "unknown estimator" when trying methods prefixed with "mi." eg "mi.empirical."

I am running windows 8.1. Any help would be much appreciated!

EDIT 1: Additional Information

After playing around some more, the main problem I am having is when trying to use the discretize function like so:

> data(syn.data)
> disc <- "equalwidth"
> nbins <- sqrt(nrow(syn.data))
> ew.data <- discretize(syn.data, disc, nbins)

Error: could not find function "discretize"

This causes the same Error in all functions eg build.mim or minet which utilise discretize. I can run build.mim successfully without including discretize.

In addition, I am getting errors if I use minet (whilst excluding the discretize argument) with any of the mi.* estimation methods, eg

> res<-minet(syn.data,"mrnet","mi.empirical","equal width",10)
Error in build.mim(dataset, estimator, disc, nbins) : 
  could not find function "mutinformation"

However, running the same function with the "spearman" estimator works fine.

Edit 2: Output of sessionInfo()

> sessionInfo()
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252    LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                            LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] minet_3.20.0

loaded via a namespace (and not attached):
[1] tools_3.1.0

discretize() is a function from the package infotheo that you can find in CRAN. There are some references to that package in the minet documentation. Maybe the authors of minet have moved some functionality to the infotheo package but since it is not a dependency it does not get installed automatically. It may be worth contacting the authors about this.

library(infotheo)
data(syn.data)
disc <- "equalwidth"
nbins <- sqrt(nrow(syn.data))
ew.data <- discretize(syn.data, disc, nbins)

The same applies for the multiinformation() function(). It is part of the infotheo package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM