Forum Stats

  • 3,757,792 Users
  • 2,251,266 Discussions
  • 7,869,916 Comments

Discussions

store data via sql dev

981516
981516 Member Posts: 42
edited Apr 30, 2013 9:34AM in Machine Learning
hi
I cluster data and can store records and it's clustering ID in new data base via ODM. I cluster this data via SQL dev. Oracle again but I don't see clustering ID for any record for storing. how I do? do I set something in Reply or Detail node?

Best Answer

  • Mark Kelly-Oracle
    Mark Kelly-Oracle Member Posts: 686
    Accepted Answer
    Hi Nasiri,
    In your description, you have only the Cluster Node as input to the Apply node. You also have to connect a data source type node to it as well. Just to get this working, why don't you connect the input data source to your Cluster node to the Apply node. So the apply node should have 2 inputs, a data source type node as well as a model node.
    Thanks, Mark

Answers

  • Hi Nasiri,

    In ODMr (SQL Dev) you would use an Apply node and have as input, the Cluster Build Model node (or a Model Node with Cluster models in it) and a data source node of some form (Data Source node, or some node that generates data for Apply to score).
    The default setting for Cluster apply would generate a result like the following, which includes the most like cluster id and its probability.
    Can you provide more details.
    You can copy past the sql generated by the Apply node that will show what sql functions you are using.
    Thanks, Mark

    CLUS_KM_1_4_CLID CLUS_KM_1_4_PROB CLUS_OC_1_4_CLID CLUS_OC_1_4_PROB CLUS_EM_1_4_CLID CLUS_EM_1_4_PROB
    ---------------- ---------------- ---------------- ---------------- ---------------- ----------------
                  11 0.98621365057984                9 0.99999892711639               14 0.99999969245730 
    Sample sql:
    /* SQL Deployed by Oracle SQL Developer 4.0.0.11.50 from Node "Apply", Workflow "ClusterApply", Project "Project1", Connection "dmuser_121_rtm_adc6141131" on Apr 29, 2013 */
    --ALTER SESSION FOR OPTIMIZER
    ALTER SESSION set "_optimizer_reuse_cost_annotations"=false;
    ALTER SESSION set NLS_NUMERIC_CHARACTERS=".,";
    WITH 
    /* Start of sql for node: MINING_DATA_BUILD_V */
    "N$10001" as (select /*+ inline */ "MINING_DATA_BUILD_V"."AGE", 
    "MINING_DATA_BUILD_V"."OCCUPATION", 
    "MINING_DATA_BUILD_V"."FLAT_PANEL_MONITOR", 
    "MINING_DATA_BUILD_V"."CUST_INCOME_LEVEL", 
    "MINING_DATA_BUILD_V"."YRS_RESIDENCE", 
    "MINING_DATA_BUILD_V"."HOME_THEATER_PACKAGE", 
    "MINING_DATA_BUILD_V"."HOUSEHOLD_SIZE", 
    "MINING_DATA_BUILD_V"."BULK_PACK_DISKETTES", 
    "MINING_DATA_BUILD_V"."Y_BOX_GAMES", 
    "MINING_DATA_BUILD_V"."AFFINITY_CARD", 
    "MINING_DATA_BUILD_V"."CUST_ID", 
    "MINING_DATA_BUILD_V"."PRINTER_SUPPLIES", 
    "MINING_DATA_BUILD_V"."CUST_MARITAL_STATUS", 
    "MINING_DATA_BUILD_V"."EDUCATION", 
    "MINING_DATA_BUILD_V"."CUST_GENDER", 
    "MINING_DATA_BUILD_V"."COUNTRY_NAME", 
    "MINING_DATA_BUILD_V"."OS_DOC_SET_KANJI", 
    "MINING_DATA_BUILD_V"."BOOKKEEPING_APPLICATION" 
    from "DMUSER"."MINING_DATA_BUILD_V"  )
    /* End of sql for node: MINING_DATA_BUILD_V */
    ,
    /* Start of sql for node: Apply */
    "N$10007" as (SELECT /*+ inline */
    CLUSTER_ID("DMUSER"."CLUS_KM_1_4" USING *) "CLUS_KM_1_4_CLID", 
    CLUSTER_PROBABILITY("DMUSER"."CLUS_KM_1_4" USING *) "CLUS_KM_1_4_PROB", 
    CLUSTER_ID("DMUSER"."CLUS_OC_1_4" USING *) "CLUS_OC_1_4_CLID", 
    CLUSTER_PROBABILITY("DMUSER"."CLUS_OC_1_4" USING *) "CLUS_OC_1_4_PROB", 
    CLUSTER_ID("DMUSER"."CLUS_EM_1_4" USING *) "CLUS_EM_1_4_CLID", 
    CLUSTER_PROBABILITY("DMUSER"."CLUS_EM_1_4" USING *) "CLUS_EM_1_4_PROB"
    FROM "N$10001" )
    /* End of sql for node: Apply */
    select * from "N$10007" where rownum < 2 ; 
  • 981516
    981516 Member Posts: 42
    Hi Mark
    I set a Source node for data, then connect it to a Cluster node, then connect Cluster node to Model Detail and Apply Node, and connect Model and Apply to Explorer node and Update data node.
    I can store clustering property. I need to store clustering ID for any record in other word in each record I see a record of input data and it's clustering ID.
    in ODM after clustering I create publish data in Apply section and create table with input record and it's cluster ID.
  • Mark Kelly-Oracle
    Mark Kelly-Oracle Member Posts: 686
    Accepted Answer
    Hi Nasiri,
    In your description, you have only the Cluster Node as input to the Apply node. You also have to connect a data source type node to it as well. Just to get this working, why don't you connect the input data source to your Cluster node to the Apply node. So the apply node should have 2 inputs, a data source type node as well as a model node.
    Thanks, Mark
This discussion has been closed.