Closed basaldella closed 7 years ago
Can you explain the models and input data a bit more? I can't diagnose anything from the example.
Yeah, I'm sorry, you're right. I created a gist with the example code and data, I hope this helps.
In the code, as you can see, the formulae are the equal, the datasets (generated with the same tool) are very similar, but somehow plotnet(akecModel)
fails, while plotnet(semevalModel)
works. The same happens when I try to run garson
and lekprofile
as well.
You need to rename the formula
object to something else. formula
is already a function in R and that's causing problems in the NeuralNetTools functions. This should work:
library(nnet)
library(NeuralNetTools)
formulaA = AKEC ~
tf +
Freq_Sentence +
Height +
LifeSpan +
Depth +
tf.idf +
Maximality
formulaS = SEMEVAL2010 ~
tf +
Freq_Sentence +
Height +
LifeSpan +
Depth +
tf.idf +
Maximality
AKEC_train <- read.csv("https://gist.githubusercontent.com/basaldella/ebb672efbb12c565dec585a6ed0916b4/raw/b9dc49dffa6e8caa758cacd0a5acf8148b73c89e/akec.top.csv",stringsAsFactors = TRUE)
SEMEVAL_train <- read.csv("https://gist.githubusercontent.com/basaldella/ebb672efbb12c565dec585a6ed0916b4/raw/b9dc49dffa6e8caa758cacd0a5acf8148b73c89e/semeval.top.csv",stringsAsFactors = TRUE)
set.seed(1203)
akecModel = nnet(formulaA,
size = length(attr(terms(formulaA),"variables")) * 2,
entropy=T,data = AKEC_train)
set.seed(1203)
semevalModel = nnet(formulaS,
size = length(attr(terms(formulaS),"variables")) * 2,
entropy=T,data = SEMEVAL_train)
plotnet(akecModel)
plotnet(semevalModel)
Now it works like a charm. Sorry for my mistake, but I'm far from being an R expert... Thanks a lot for your help!
No problem, I'm happy to help.
Hello,
I have a strange error when trying to use
plotnet
. Let's assume I have two models, calledm1
andm2
, which are trained using the exact same formula on two different datasets.If I do
Everything works fine.
But if run
What i get is
Do you have any idea of what could cause this problem?