Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Unable to load old models: backward compatibility problem?

  1. #1
    Join Date
    Oct 2016

    Default Unable to load old models: backward compatibility problem?

    Dear all,

    I've been developing for many years now a Java application that uses WEKA as learning library. After upgrading our WEKA jar from 3.7.9 to 3.9.0, we are unable to use the old saved models because the train header can't be properly read anymore. We have identified the problem in the transition from WEKA 3.7.11 to 3.7.12.

    These few lines of code can reproduce the error:

    import weka.core.SerializationHelper;
    import weka.core.Instances;
    import hr.irb.fastRandomForest.FastRandomForest;

    // read both model and train header
    Object[] obj = SerializationHelper.readAll( "classifier 2.0 .model" );
    // cast first object to FastRandomForest
    FastRandomForest frf = (FastRandomForest) obj[ 0 ];
    // cast second object to Instances
    Instances data = (Instances) obj[ 1 ];

    The exception thrown is the following:

    at weka.core.Attribute.enumerateValues(
    at weka.core.Attribute.toString(
    at java.lang.String.valueOf(
    at java.lang.StringBuffer.append(
    at weka.core.Instances.toString(
    at common.AbstractInterpreter.execute(
    at common.AbstractInterpreter$

    It seems the Instances class has changed fields since version 3.7.11 and some values are not readable any more. Is there any solution to maintain backward compatibility of the models or the users should create brand new models from scratch?

    Thanks a lot for your help!

  2. #2
    Join Date
    Aug 2006


    This has been answered over in the Weka mailing list:


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.