Forum Stats

  • 3,781,081 Users
  • 2,254,478 Discussions
  • 7,879,557 Comments

Discussions

Problem running DM Java API in 10.2

660257
660257 Member Posts: 3
edited Oct 7, 2008 5:04AM in Machine Learning
Hi,

I hope that there are other users of the 10.2 Java API here. I have run into trouble when executing the following steps:.
a. create a ClassificationSettings object
b. relate it to an existing cost matrix using setCostMatrixName
c. save using Connection.saveObject.
d. retrieve the object, using Connection.retrieveObject

result: I find that the object has been retrieved in full, except for the cost matrix name, which was reset to NULL

If I try to continue with my code I eventually receive this error (naturally...)
ORA-40302: invalid classname 0 in cost matrix specification

Has anyone encountered simiilar problems?

Thanks
Tagged:

Answers

  • jdadashev-Oracle
    jdadashev-Oracle Member Posts: 57 Employee
    Hi,

    Could you please let me know what version of Oracle JDM API as well as RDBMS are you using, 10.2.0.4 or 10.2.0.5?
    Also could you post the exact fragment of your code. This is really important for me because there are differences between
    the versions.

    Thanks,
    Jim
    jdadashev-Oracle
  • 660257
    660257 Member Posts: 3
    Hi Jim,

    Thanks for the help, and sorry for the delayed reply.
    The Oracle version is "Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod "
    As for the API version, I do not know that it gets more fine grained than "10.2" (which is what I am using). When I use the connection's getMetaData method it return's the Oracle version mentioned above.

    The code I am using is:
    ...
    // Create ClassificationSettings
    ClassificationSettings buildSettings = m_clasFactory.create();
    buildSettings.setAlgorithmSettings(treeAlgo);
    buildSettings.setCostMatrixName(m_costMatrixName);
    buildSettings.setTargetAttributeName("BRANCH");
    m_dmeConn.saveObject(m_classSetName, buildSettings, true);
    // 3. Create, save & execute Build Task
    BuildTask buildTask =
    m_buildFactory.create(m_BDName, m_classSetName,
    m_modelName);
    buildTask.setDescription(m_buildTaskName);
    saveTask(buildTask, m_buildTaskName, null);

    // debug
    ClassificationSettings retrieve =
    (ClassificationSettings) m_dmeConn.retrieveObject(m_classSetName,
    NamedObject.buildSettings);

    Basically this is slightly varied code from the demo program dmtreedemo.java, that can be downloaded from Oracle using this link:
    http://www.oracle.com/technology/products/bi/odm/index.html


    Thanks again,...
  • jdadashev-Oracle
    jdadashev-Oracle Member Posts: 57 Employee
    Hi,

    I am trying to reproduce the problem. Unfortunately I don't have the 10.2.0.1 db.
    I am trying to reproduce it on 10.2.0.4
    Is there a chance you can migrate to a later patch release?
    Also I noticed that in your code you have a call:
    saveTask(buildTask, m_buildTaskName, null);
    What exactly is this function doing?

    Thanks
    Jim
    jdadashev-Oracle
  • jdadashev-Oracle
    jdadashev-Oracle Member Posts: 57 Employee
    Can you try this:

    ClassificationSettings retrievedBuildSettings =
    (ClassificationSettings)model.getBuildSettings();

    String costMatrixName = retrievedBuildSettings.getCostMatrixName();

    instead of your code:

    // debug
    ClassificationSettings retrieve =
    (ClassificationSettings) m_dmeConn.retrieveObject(m_classSetName,
    NamedObject.buildSettings);


    It works for me on 10.2.0.4

    Thanks,
    Jim
    jdadashev-Oracle
  • 660257
    660257 Member Posts: 3
    Hi Jim,

    Again sorry for the delay. I am a freelance working at this project once a week, so advancement is slow...
    Thank you very much for trying to help. For various reasons I cannot upgrade to 10.2.0.4 - it is not up to me.
    I have more or less given up on the Oracle API for now, and am trying out some open source (weka), in hope that I will be able to do the debugging myself there. Thanks again for helping out.

    Regards,
    Ido
This discussion has been closed.