3

I'm trying to use hill-climbing function hc() in bnlearn package . Despite that all columns of my data frame are factor and carry no NA values, I still kept getting such error message:

Error in hill.climbing(x = x, start = start, whitelist = whitelist, blacklist = blacklist,  : 
  INTEGER() can only be applied to a 'integer', not a 'NULL'

The following is my hc function code.

 hcdata<-hc(data, score = "bic" )
 hcdatafit <- bn.fit(hcdata, train)

What might cause this problem? Thanks!

picciano
  • 22,341
  • 9
  • 69
  • 82
  • can you add the results of `str(yourdata)` to the question please (where `yourdata` is the dataframe that you passed to `hc`) – user20650 May 04 '18 at 11:13

0 Answers0