On 10/11/12 6:54 AM, sottostee wrote:
I've the same problem but in opposite direction.
I've problem with decision trees but not with MultiLayerPerceptron...
I want to classify a single instance So i have previously create an empty
dataset with an appropriate header (class and all the attributes), and after
i classify, at a time, a single instance (net.classifyInstance(ist);).
If i use an MultilayerPerceptron all work very well but if i use a decision
tree (like J48 or LMT) i've your same problem:
DenseInstance doesn't have access to a dataset!
You just need to call setDataset() on the test Instance object to give
it a reference to the attribute information from an Instances object.
> how did you solve this problem?
> Thanks in advance
> Jagadeesh Varati wrote:
>> I'm reading the learned model into an
>> ObjectInputStream object and creating a Classifier
>> from it. Then I'm creating an Instance with a,b,c as
>> variables and setting y=0 which is the classifier
>> Then I'm running
>> clsLabel = aClassifier.classifyInstance(anInstance);
>> If I use LinearRegression, this is working fine. But,
>> if I use a MultilayerPerceptron classifier, I'm
>> getting an error:
>> Exception in thread "main"
>> weka.core.UnassignedDatasetException : Instance
>> doesn't have access to a dataset!
>> Do I need to do something different for
>> MultilayerPerceptron ?
>> Can anyone tell me where I'm going wrong ?