The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here.

"Error when adding column to database"

luico14luico14 Member Posts: 1 Contributor I
edited May 2019 in Help

I am having a big problem in RapidMiner. Basically I have a decision tree model that is loaded through a ModelLoader then it is applied to a DataBaseExampleSource, which is checked  work_on_database=true, since I need the results of the ModelApplier operator to be saved in the database. But an error ocurrs. This is my XML.

<operator name="Root" class="Process" expanded="yes">
    <operator name="ModelLoader" class="ModelLoader">
        <parameter key="model_file" value="E:\decision_tree_12.mod"/>
    <operator name="DatabaseExampleSource" class="DatabaseExampleSource">
        <parameter key="work_on_database" value="true"/>
        <parameter key="database_system" value="Oracle"/>
        <parameter key="database_url" value="jdbc:oracle:thin:@"/>
        <parameter key="username" value="cubos"/>
        <parameter key="password" value="oqB51Til3OKBJGwWKQWJsA=="/>
        <parameter key="query" value="select * from cubos.tmp_mkt_achurn"/>
        <parameter key="table_name" value="TMP_MKT_ACHURN"/>
        <parameter key="label_attribute" value="CHURN"/>
        <parameter key="id_attribute" value="ID_CUENTA"/>
    <operator name="ModelApplier" class="ModelApplier">
        <parameter key="keep_model" value="true"/>
        <list key="application_parameters">

And this is the error:

May 19, 2009 11:08:24 AM: [NOTE] Process starts
P May 19, 2009 11:08:24 AM: Process:
  Root[1] (Process)
  +- ModelLoader[1] (ModelLoader)
  +- DatabaseExampleSource[1] (DatabaseExampleSource)
  +- ModelApplier[1] (ModelApplier)
P May 19, 2009 11:08:59 AM: [Warning] Tree: The number of regular attributes of the given example set does not fit the number of attributes of the training example set, training: 12, application: 13
G May 19, 2009 11:08:59 AM: [Fatal] RuntimeException occured in 1st application of ModelApplier (ModelApplier)
G May 19, 2009 11:08:59 AM: [Fatal] Process failed: operator cannot be executed (Error while adding a column 'prediction(CHURN)'to database: java.sql.SQLException: ORA-00904: : invalid identifier

). Check the log messages...
          Root[1] (Process)
          +- ModelLoader[1] (ModelLoader)
          +- DatabaseExampleSource[1] (DatabaseExampleSource)
here ==> +- ModelApplier[1] (ModelApplier)

Please can anybody provide some help to solve this?

Thanks, in advance,  :)


  • Options
    haddockhaddock Member Posts: 849 Maven

    I'm not sure this will help, but here goes anyway...
    it is applied to a DataBaseExampleSource, which is checked  work_on_database=true, since I need the results of the ModelApplier operator to be saved in the database.
    You don't actually need to work directly on the database, you could extract an example set from the database, apply the model, and then write a new table. I do this on an MS database and all works fine. What occurs to me is that it is adding the column that is messing up. Just my two cents..

    Good luck anyway
  • Options
    keithkeith Member Posts: 157 Maven
    Another possible issue could be whether the username you are connecting to the database with has been granted permission to modify the table structure.

    But the real solution is as haddock mentions.  Generate the prediction results from the Model Applier in RM, then write the Example Set created to a new table in the database.  That way you don't clobber your original table if something screws up either.  I do almost all of my RM work by interacting with databases, and haven't needed to use work_on_database yet.

Sign In or Register to comment.