Finding association rule (creating problem)

sir i m working on xquery for finding assocation rule using xquery i complete the conding for how i write xquery for that. but now i found a problem that they give me error that _"Unexpected token "declare function" beyond end of query_" i send me coding part for u plz help me out for how i do.........i m using oxygen xml developer for running the xquery my simple query running proper but we use more than one function in recursive manner they create problem give error Unexpected token "declare function" beyond end of query.
(: You can activate the content completion by pressing the Ctrl+Space keys. :)
xquery version "1.0";
(: Namespace for the <oXygen/> custom functions and variables :)
declare namespace oxy="http://www.oxygenxml.com/xquery/functions";
declare namespace global="http://www.oxygenxml.com/xquery/functions";
(: The URI of the document that is to be queried :)
declare variable $oxy:document-uri as xs:string := "transaction.xml";
declare variable $oxy:document-to-query as xs:string := "transaction.xml";
declare variable $local:document-to-query as xs:string := "transaction.xml";
declare variable $oxy:document as document-node() := doc($oxy:document-uri);
let $src := doc("transaction.xml")//items
let $minsup:=2
let $total:=count($src)*1.00
let $c:=distinct-values($src/*)
let $l:=(for $itemset in $c
let $items:=(for $item in $src/*
where $itemset=$item
return $item)
let $sup:=(count($items)+1)
where $sup>=$minsup
return <largeItemset>
<items> {$items} </items>
<support> {$sup} </support>
</largeItemset>)
let $L:=$l
return <largeItemsets>{oxyl:FP-growth($l,$L,$minsup,$total,$src)}
</largeItemsets>
_/////that part is fine but we we use next fp-growth function they give same error
plz sir help me for solving this////*
declare function oxy:FP-growth(element $l, element $L, element $minsup, element $total, element $src)
returns element {
let $f-item:= first item in $L
let $l-item:= last item in $L
let $T:=oxy:getl-itemsets($src, $total, $minsup)
return <items>
{oxy:join ($l-item, $T)}
</items>
let $l:=$l-items
let $L:=oxy:remove($l)
for f-item in $L
where $f-item != $l-item
return oxy:FP-growth($l, $L, $minsup, $total, $src)
declare function oxy:getl-itemsets(element $src, element $total, element $minsup)
returns element {
let $l:=(for $itemset in $src
where $itemset=$l-item
return $itemset)
let $sup:=(count($l)+1
where $sup>=$minsup
return <largeItemset>
<items> {$item} </items>
<support> {$sup} </support>
</largeItemset>
declare function oxy:join(element $X, element $Y) returns element {
let $items := (for $item in $Y
where every $i in $X satisfies
$i != $item
return $item)
return $X union $items
declare function oxy:removeDuplicate(element $C) returns element
for $itemset1 in $C
let $items1 := $itemset1/*
let $items :=(for $itemset2 in $C
let $items2 := $itemset2/*
where $itemset2>>$itemset1 and
count($items1) =
count(commonIts($items1, $items2))
return $items2)
where count($items) = 0
return $itemset1
input file for this xquery is:=
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="personal-schema.css"?>
<transactions>
<transaction id="1">
<items>
<title>The Green Mile</title>
<author>Stephen King</author>
<item>a</item>
<item>d</item>
<item>e</item>
</items>
</transaction>
<transaction id="2">
<items>
<title>The Green Mile</title>
<author>J. D. Salinger</author>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</transaction>
<transaction id="3">
<items>
<title>The Green Mile</title>
<author>Issac Asimov</author>
<item>a</item>
<item>c</item>
<item>e</item>
</items>
</transaction>
<transaction id="4">
<items>
<title>The Green Mile</title>
<author>Isaac Asimov</author>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</transaction>
<transaction id="5">
<items>
<title>The Green Mile</title>
<author>Oscar Wilde</author>
<item>a</item>
<item>b</item>
</items>
</transaction>
</transactions>
Edited by: 920412 on Mar 12, 2012 11:26 PM
Edited by: 920412 on Mar 14, 2012 10:57 PM
Edited by: 920412 on Mar 14, 2012 11:17 PM

thank u sir my code is running
but there is one problem the result he regerate is not correct sir
i send the complete information to u my input file my project code my output file and my actual output that i need ......plz sir chek it where is he logical mistak in code i completely chek lots of time i m not able to find where is the logical mistak plz sir help me
input file "transactions.xml"
<?xml version="1.0" standalone="yes"?>
<transactions>
<transaction id="1">
<items>
<item>a</item>
<item>d</item>
<item>e</item>
</items>
</transaction>
<transaction id="2">
<items>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</transaction>
<transaction id="3">
<items>
<item>a</item>
<item>c</item>
<item>e</item>
</items>
</transaction>
<transaction id="4">
<items>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</transaction>
<transaction id="5">
<items>
<item>a</item>
<item>b</item>
</items>
</transaction>
</transactions>
coding :=
xquery version "1.0";
declare namespace local = "http://www.w3.org/2003/11/xpath-local-functions";
declare function local:join($X as element()*, $Y as element()*) as element()* {
let $items := (for $item in $Y
where every $i in $X satisfies
$i != $item
return $item)
return $X union $items
declare function local:commonIts($X as element()*, $Y as element()*) as element()* {
for $item in $X
where some $i in $Y satisfies $i = $item
return $item
declare function local:removeIts($X as element()*, $Y as element()*) as element()* {
for $item in $X
where every $i in $Y satisfies $i != $item
return $item
declare function local:candidateGen($l as element()*) as element()* {
for $freqSet1 in $l
let $items1 := $freqSet1//items/*
for $freqSet2 in $l
let $items2 := $freqSet2//items/*
where $freqSet2 >> $freqSet1 and
count($items1)+1 = count($items1 union $items2)
and local:prune(local:join($items1,$items2), $l)
return
<items>{local:join($items1,$items2)}</items>
declare function local:prune($X as element()*, $Y as element()*) as xs:boolean
every $item in $X satisfies
some $items in $Y//items satisfies
count(local:commonIts(local:removeIts($X,$item),$items/*))
= count($X) - 1
declare function local:removeDuplicate($C as element()*) as element()*
for $itemset1 in $C
let $items1 := $itemset1/*
let $items :=(for $itemset2 in $C
let $items2 := $itemset2/*
where $itemset2>>$itemset1 and
count($items1) =
count(local:commonIts($items1, $items2))
return $items2)
where count($items) = 0
return $itemset1
declare function local:getLargeItemsets($C as element()*, $minsup as xs:decimal, $total as xs:decimal, $src as element()*) as element()*
for $items in $C
let $trans := (for $tran in $src
where every $item1 in $items/* satisfies
some $item2 in $tran/*
satisfies $item1 = $item2
return $tran)
let $sup := (count($trans) * 1.00) div $total
where $sup >= $minsup
return <largeItemset> {$items}
<support> {$sup} </support>
</largeItemset>
declare function local:fp-growth($l as element()*, $L as element()*, $minsup as xs:decimal, $total as xs:decimal, $src as element()*) as element()*
let $C := local:removeDuplicate(local:candidateGen($l))
let $l := local:getLargeItemsets($C, $minsup, $total, $src)
let $L := $l union $L
return if (empty($l)) then
$L
else
local:fp-growth($l, $L, $minsup, $total, $src)
let $src := doc("transactions.xml")//items
let $minsup := 0.5
let $total := count($src) * 1.00
let $C := distinct-values($src/*)
let $l :=(for $itemset in $C
let $items := (for $item in $src/*
where $itemset = $item
return $item)
let $sup := (count($items) * 1.00) div $total
where $sup >= $minsup
return <largeItemset>
<items> {$itemset} </items>
<support> {$sup} </support>
</largeItemset>)
let $L := $l
return <largeItemsets> { local:fp-growth($l, $L,$minsup, $total, $src) }
</largeItemsets>
output that is get for running the query:=
<?xml version="1.0" encoding="UTF-8"?>
<largeItemsets>
<largeItemset>
<items>a</items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<items>d</items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<items>b</items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<items>c</items>
<support>0.6</support>
</largeItemset>
</largeItemsets>
but sir i want my output like that:=
<?xml version="1.0" standalone="yes"?>
<largeItemsets>
<largeItemset>
<Items>
<item>a</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>d</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>b</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>c</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>d</item>
<item>b</item>
</Items>
<support>0.4</support>
</largeItemset>
<largeItemset>
<Items>
<item>b</item>
<item>c</item>
</Items>
<support>0.4</support>
</largeItemset>
<largeItemset>
<Items>
<item>d</item>
<item>c</item>
<item>b</item>
</Items>
<support>0.4</support>
</largeItemset>
</largeItemsets>
sir i want that out which i shown last help me sir how i sort out this problem
thank i advance

Similar Messages

  • Association rules - Memory problem?

    I am running the associtaion rules program in Java and I get
    the following error. Any idea what causes this error?
    Thank u
    K
    arBuildTask_jdm is started, please wait. arBuildTask_jdm is failed.
    Failure Description: ORA-40101: Data Mining System Error ORA-40101: Data Mining System Error ORA-40101: Data Mining System Error ODM_ASSOCIATION_MODEL-BUILD--20010
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 144
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 1397
    ORA-00600: internal error code, arguments: [15593], [kxhfFind: no partition with a full slot], [], [], [], [], [], []
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 144
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 1397
    ORA-06512: at "DMSYS.DBMS_DATA_MINING", line 312
    ORA-06512: at "DMSYS.DBMS_JDM_INTERNAL", line 157
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "DMSYS.DBMS_JDM_INTERNAL", line 179
    ORA-06512: at line 1
    --

    This is a known bug that has been fixed in the upcoming database release (11g).

  • Interpretationg of unformatted association Rules

    Hi,
    I have sucessfully built a Association Rule Model. I viewed the Association Rules created by the model using the following query:
    SQL> SELECT rule_id, antecedent, consequent, rule_support,
    2 rule_confidence
    3 FROM TABLE(DBMS_DATA_MINING.GET_ASSOCIATION_RULES('Asso_Demo'));
    Can someone tell me how to interpret the unformated rules in the absence of Oracle Data Miner?

    I also would like to transform this antecedent format :
    SYS.DM_PREDICATE(SYS.DM_PREDICATE,SYS.DM_PREDICATE,SYS.DM_PREDICATE)
    To something readable. I found in the documentation that we can refer to dmnbdemo.sql for generation of formatted rules. Here is the code :
    column tname format a14
    column tval format a4
    column pname format a20
    column pval format a13
    column priorp format 9.9999
    column condp format 9.9999
    WITH
    bin_label_view AS (
    SELECT col, bin, (DECODE(bin,'1','[','(') || lv || ',' || val || ']') label
    FROM (SELECT col,
    bin,
    LAST_VALUE(val) OVER (
    PARTITION BY col ORDER BY val
    ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING) lv,
    val
    FROM nb_sh_sample_num)
    UNION ALL
    SELECT col, bin, val label
    FROM nb_sh_sample_cat
    model_details AS (
    SELECT T.target_attribute_name tname,
    TO_CHAR(
    NVL(T.target_attribute_num_value,T.target_attribute_str_value)) tval,
    C.attribute_name pname,
    NVL(L.label, NVL(C.attribute_str_value, C.attribute_num_value)) pval,
    T.prior_probability priorp,
    C.conditional_probability condp
    FROM TABLE(DBMS_DATA_MINING.GET_MODEL_DETAILS_NB('NB_SH_Clas_sample')) T,
    TABLE(T.conditionals) C,
    bin_label_view L
    WHERE C.attribute_name = L.col (+) AND
    (NVL(C.attribute_str_value,C.attribute_num_value) = L.bin(+))
    ORDER BY 1,2,3,4,5,6
    SELECT tname, tval, pname, pval, priorp, condp
    FROM model_details
    WHERE ROWNUM < 11;
    What means this + between parenthesis ? I understand the model_details part but what is the bin_label_view doing ? Is there someone who already adapted this code to association rule models ?

  • Association Rules problem

    Hello,
    I have a problem with making association rules in Oracle 10g ODM. The problem is as follows:
    I have my test dataset for testing assoc. rules. I used that dataset before for testing assoc. rules models with Oracle 9i ODM release (9.2.0.4). And I have found significant number of rules within that dataset when I used Oracle 9i ODM (9.2.0.4.).
    But when I use Oracle 10g ODM to build an association rules model with the same set of parameters (min. support, min. confidence and max. rule length) I've got 0 rules.
    I can't find where is the problem, so I think that there is some sort of bug within Oracle 10g ODM.
    Does anyone have similar experience or have some explanation for this?
    Thnx in advance,
    Ivan

    What version of Data Miner are you using?
    If you are using the api directly, are you using the
    java or pl/sql api.
    Thanks, MarkI've been using Java API.
    I've continued my investigation of the mentioned problem and I have found that DMS throws following exception:
    ORA-38605: FI not enough memory (stringK) for candidate generation(stringK)
    Cause: There was insufficient available memory for candidate generation.
    Suggested action from Metalink is:
    In workarea_size_policy='manual' mode, set ficarea_size to a reasonably larger value. Or, in workarea_size_policy='auto' mode, set pga_aggregate_target to a reasonably larger value
    And I've increased the size of my SGA more than three times (from 128 to 512 MB), set work_area_policy=auto and set pga_aggregate_target to 20% of SGA .
    After that I've got following exception:
    ORA-40101: Data Mining System Error ODM_ASSOCIATION_MODEL-BUILD--20010
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 150
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 1299
    ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 1364
    ORA-06512: at line 1
    DMS throws this exception after longer time of task execution.
    Now, I don't know what to do further.
    I repeat that with the same dataset and same model parameters (support, confidence and max. rule length) I've got significant number of rules with ODMS within Oracle 9i database (9.2.0.4).
    Thnx,
    Ivo

  • Problems with Association Rules

    Hi all,
    I am trying to use ODMr to run association rules and am getting the following error message:
    Server task state: error
    Server task detail:
    ORA-40101: Data Mining System Error ORA-40101: Data Mining System Error ORA-40101: Data Mining System Error ODM_ASSOCIATION_MODEL-BUILD--20010
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 144
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 1396
    ORA-00902: invalid datatype
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 144
    ORA-06512: at "DMSYS.ODM_ASSOCIATION_RULE_MODEL", line 1396
    ORA-06512: at "DMSYS.DBMS_DATA_MINING", line 305
    ORA-06512: at "DMSYS.DBMS_JDM_INTERNAL", line 157
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
    ORA-06512: at "DMSYS.DBMS_JDM_INTERNAL", line 179
    ORA-06512: at line 1
    This error is generated on the sample data as used in the ORACLE 10G Release 2 Data Mining Tutorial, and on other datasets that I tried.
    My sense is that the algorithm is expecting data in the datatype of DM_NESTED_NUMERICALS, even though the documentation asks for transactional data. When I converted to nested columns, the prog errored out again as it was expecting a number rather than nested column.??

    Hi Carolyn,
    I reviewed the tutorial and tested out the example for Association Rules. The example uses SH.SALES and SH.PRODUCTS.
    It worked fine.
    ODMr converts the "transactional" data, in the case of Association Rules, into DM_NESTED_NUMERICALS.
    When ODM documentation refers to transactional data, it implies the use of nested columns. This can be confusing given that older versions of ODM actually supported a "transactional format", which is now supported only through nested columns.
    I copied the following view definition that was passed in to ODM to build the Association Rules model (based on the tutorial noted above). Take a look at them to get a better understanding on what ODMr is doing to prepare the data.
    If you can give us a specific example including the tutorial table you used and the settings you specified in the Association Rules Wizard, I can review that to see what the problem might be.
    Thanks, Mark
    SELECT caseTable."DMR$CASE_ID", txnTable1."PROD_ID" FROM "DMUSER"."DM4J$VSALES657013432" caseTable, (SELECT "DMR$CASE_ID", CAST(COLLECT(DM_Nested_Numerical("NAME", "VALUE")) AS DM_Nested_Numericals) "PROD_ID" FROM "DMUSER"."DM4J$SALES423975876" GROUP BY "DMR$CASE_ID") txnTable1 WHERE caseTable."DMR$CASE_ID" = txnTable1."DMR$CASE_ID"
    The view makes references to other tables/views defined below:
    DM4J$VSALES657013432 is shown below:
    SELECT distinct "DMR$CASE_ID" FROM
         (SELECT "CUST_ID","TIME_ID", DENSE_RANK() OVER (ORDER BY "CUST_ID","TIME_ID") DMR$CASE_ID FROM "SH"."SALES")
    ORDER BY "DMR$CASE_ID"
    DM4J$SALES423975876 is shown below:
    SELECT DMR$CASE_ID, CAST("PROD_ID" AS VARCHAR2(30)) as NAME, 1 as VALUE
    FROM
    (SELECT "PROD_ID", "CUST_ID","TIME_ID", DENSE_RANK() OVER (ORDER BY "CUST_ID","TIME_ID") DMR$CASE_ID FROM "SH"."SALES")
    ORDER BY DMR$CASE_ID

  • Association rule in SQL Server Data Mining

    I have been working on a problem on association rules in SQL Server Data Tools (Visual Studio 2008) for quite a while but have not yet been able to figure out the solution.
    The problem is: I have a table named Sales_history in my SQL database. This table has following columns: CustomerID, ItemID, Month (from May2012 to April 2013), QtyShipped. I am looking to find association between Items and i want to provide recommendation
    to the Customer (In this case CustomerID) based on their purchases.
    Note: there are around 630 customers and about 34000 products in my table. 
    My approach:
    I marked History_Table as both Key and nested. And in the Key, i checked CustomerID as input and Key whereas in nested, i checked ItemId as Key, input and Predict. 
    When i run the model, i get a solution but i am not sure if i am configuring it right. Also i am not sure how i can write prediction join query to generate Item recommendations . I am really struggling with
    this problem, eagerly waiting for the reply. Thank you.

    Hi Tatyana,
    Thank you so much for your reply. I have now been able to create the data mining model using association rule and by writing a DMX query, i am able to generate the item recommendations to be given to customers for items they have purchased. However, i have
    noticed one thing that in the DMX query, it gives the same item recommendation for any item i put inside the query. 
    Also, if i put any item in the DMX query from the generated list of recommended items, the output of that query also shows the item that is inputted inside the query.
    Here is the query, that i am writing to generate item recommendations
    SELECT predictassociation (CrossSellingModelV3.[Ztb Customer Item v3],INCLUDE_STATISTICS,5)
    FROM CrossSellingModelV3
    NATURAL PREDICTION JOIN 
    (SELECT
    (SELECT '17IS56126' as m )
    AS Ms)
    AS t
    What can be the possible reason behind this? Is this something related to the kind of data i have? In my data, there are 632 distinct customers and 34000 distinct products. 
    If i execute this query in management studio.
    select customer_CD, COUNT(Item_CD) from ztb_Sales_History
    group by customer_CD
    order by 2 desc
    the output shows that  there are some customers who have bought just 1 item and also there are customers who have bought 2400 items. i mean the range is very high. 

  • I wish to rename my drive letter & not create problems

    I had an SSD installed on my PC.  The SSD is 'C' & kept for programs only. The other drive  letters I have currently got displayed don't make much sense.I started with CD burner & Blu-ray burner & got them away from my own files by changing the drive letters to Y & Z.   A USB drive which is red in color is not R drive.
    I want to give the drive that has all of my music files & its catalog data another letter.  I want to do this without having problem with file associations etc.  How is this done without creating problems?  My photos are also on this drive but I know that I can just direct that program to its catalog location.
    Since an SSD is fast enough it apparently doesn't need to be indexed.  What I have done is plugged a couple of my external drives into the PC & had Windows index every drive except 'C'.  I don't know is indexing will automatically updated the index to reflect the new drive letter for my music files but it It doesn't I'll ask for it to be done again.
    Thanks in advance

    Just before I did this I when I opened iTunes I got the message that said that I must have changed by burner or something to the effect & that I had to re install the program.
    I held of doing this because I wanted to change the drive letter first.  This I did & that appears to have worked.
    I hadn't made any changes to DVD burning software.  I did see that there was a new 64 bit version available so I downloaded & installed it.
    The next time I opened the program I got the same message that I needed to re install the program.  When I went to tell it where the library.itl I must have directed it to the wrong library as it asked me again about my account details & wanted my credit cards details.  Only after I give this information did I find that the library that I had nominated was in fact the account for my wife's iPad.
    So now I have 2 major problems firstly I'm linked to my wife's account where it displays the few things she purchased.  My library was make up 100% from all of my old CD's that I had ripped. nothing else.  How do I connect to the other library.itl file?
    The second problem is that even though I downloaded & & installed a new version of iTunes I'm getting the message that I need to reinstall because my burning software has changed & it hasn't.  How do I get past these problems?
    Thanks in advance

  • Association rules - memory issue

    Hi everyone,
    I'm testing oracle data mining to generate a high number of association rules, starting from a table containing around 100 columns and 1800 lines. I transformed the table in a view as shown with the market basket demo, but I'm still having a memory error each time I'm trying to launch the data mining process.
    I've tried with a table containing less columns and lines, and it worked fine.
    Is there a way to set ODM to allow it to process this big table and generate millions of association rules without having some memory errors ?
    Is it possible to find how exactly the apriori algorithm works, I mean to find if the sql process is only working with the RAM and writes in the database in the end, or if it commits into the database during the process (before exploding memory).
    Merry christmas by the way !!!!!

    Hi,
    thanks again for your reply. I tried the tweak with the shared_pool_size, and I'm still having some memory issues.
    Do you know how the model is build, and how it works technically ?
    I can see that itemsets and rules are created when you build the model. Is it stored in a procedure (which applies the apriori algorithm), computes the model and then stores the rules generated into the database during commit ?
    In this case all the process (model building) is stored in RAM, am I right ?
    And that's why the process crash when there are too much data processed. Is it possible to avoid this, I mean commit the rules even during the process to free some RAM space in order to continue the rule generation ?

  • Association Rules - dmardemo.java - DisplayAssociationRules method

    Hi, friends!
    I'm making some changes in the sample Java demo for the Association Rules - dmardemo.java. I've created another method which contains the name of the model just created before and in this same method, I call the method to display the association rules detected:
    public static void restoreRules(String modelNome) throws JDMException {
    m_modelName = modelNome;
    model = (AssociationModel)m_dmeConn.retrieveObject(
    m_modelName, NamedObject.model);
    displayAssociationRules(model);
    In another class, which is a GUI, I'm trying to call that method to restore all the rules found in the mining process and display them in a jTable Swing component. For this, I've tried to adapt the main method (displayAssocationRules) to do this, as follows:
    public static Object displayAssociationRules(AssociationModel model)
    throws JDMException {
    // DISPLAY TOP-10 ASSOCIATION RULES
    Object[] obj = new Object[5];
    int contador = 0;
    // 1. Set order by confidence DESC, support DESC
    OraRulesFilter filter = (OraRulesFilter) m_filterFactory.create();
    filter.setOrderingCondition(
    new RuleProperty[] { RuleProperty.confidence, RuleProperty.support},
    new SortOrder[] { SortOrder.descending, SortOrder.descending }
    // 2. Set to return the first 10 rules only
    filter.setMaxNumberOfRules(10);
    // 3. Retrieve rules
    Collection rules = model.getRules(filter);
    Iterator iRules = rules.iterator();
    while( iRules.hasNext() )
    OraAssociationRule rule = (OraAssociationRule) iRules.next();
    obj[0] = rule.getRuleIdentifier();
    //System.out.print( "Rule " + rule.getRuleIdentifier() + ": " );
    Itemset antecedent = rule.getAntecedent();
    //obj[1] = antecedent.getItems();
    Object[] ante_items = antecedent.getItems();
    // sort the items in antecedent to produce deterministic order of items
    TreeSet sortedSet = new TreeSet();
    for(int i = 0; i < obj.length; i++)
    sortedSet.add(ante_items);
    obj[1] = ante_items;
    Iterator sortedI = sortedSet.iterator();
    /*while(sortedI.hasNext())
    System.out.print(sortedI.next() + " ");*/
    Itemset consequent = rule.getConsequent();
    Object[] cons_items = consequent.getItems();
    obj[2] = cons_items;
    obj[3] = m_df.format(rule.getSupport());
    obj[4] = m_df.format(rule.getConfidence());
    /*System.out.println("==> " + cons_items[0] + " (support=" +
    m_df.format(rule.getSupport()) + ", confidence=" + m_df.format(rule.getConfidence()) + ")" );*/
    return obj;
    Some parts of the old code are present in that for you to compare what I've done. However, it's not working. What should I do to see the rules generated in the process in a jTable?
    Regards
    Luis

    As you can see in the code above, I've split the code into two parts. However, a problem is happening when I try to restore the rules to the GUI.
    "Exception in thread "AWT-EventQueue-0" javax.datamining.JDMIllegalArgumentException: The required argument objectName is null. Supply a non-null value."
    It says that I'm not passing any parameters to the method. But, as you can see, in the first method I've created, I took the name of the model and transfers it for the method displayAssociationRules as a AssociationModel objet.
    In the GUI, in an event for the button "Restore Rules", I've put this code below:
    String modelo = Principal.getModelName(); // where Principal is the main GUI class for the execution of the process.
    dmardemo.restoreRules(modelo);// I call the method in the dmardemo class to restore the rules having a String (modelo) as its parameter. That's when the problem happens. Is the argument really null, as the error message says?
    Regards
    Luis

  • Hiding Sensitive Association Rule for Sanitization algorithm implementation

    Hello Sir,
    I am doing my research in the area of Data Mining and my problem is hiding industrial information using Hiding Sensitive Association Rule. If anybody having Sanitization process and algorithm implementation using Java.
    If anybody having relate materials, algorithms implementation, documentation and related web address. Please send to my mail id: [email protected]
    Regard
    Kannan
    Message was edited by:
    user591845

    And your version of Oracle is?
    If 10g look into using Transparent Data Encryption (TDE). You can find docs on it at http://tahiti.oracle.com.

  • Unable to find associated SLD element

    Hello,
    We are currently setting up our PI 7.1 evaluation system. When we assign a business system (ECC6.0) from the SLD in the Integration Builder and tick "Create communication channels automatically" we receive the following error message:
    Could not create communication channel: Unable to find associated SLD element for specified class (source element: SAP_BusinessSystem, [CreationClassName, SAP_BusinessSystem, string, Name, test, string], target element class: SAP_HTTPServicePort)
    In the IB the following communication channels are however created successfully:
    - GeneratedReceiverChannel_HTTP
    - GeneratedReceiverChannel_RFC
    - GeneratedReceiverChannel_IDoc
    - GeneratedReceiverChannel_XI
    - GeneratedReceiverChannel_WS_Local
    - GeneratedSenderChannel_WS
    Any idea what this error message means and how to correct it?

    Thanks for the reponses.
    Abhishek,
    I've been through the forum posts and they all refer to issues with the Adapter Framework or Integration Directory. I have worked through them though and none of the resolutions help with my issue.
    Divya,
    Regarding note 1117249; yes I saw this can be an issue from previous posts on SDN so have confirmed the PI components are all present in the SLD, as shown below, and registered against the same domain:
    - Adapter Engine on (SID)
    - Domain (host)
    - Integration Directory on (SID)
    - Integration Repository on (SID)
    - Integration Server on (host)
    - RWB on (SID).(host)
    Regarding note 764176; I have checked the RWB and all expected components are present and green (except web service security, which is amber):
    - Integration Server
    -- Integration Engine (SID) 
    -- Business Process Engine (SID)
    -- Mapping Runtime (SID) 
    -- Adapter Engine (SID)
    Ran the Cache Connectivity Test from RWB and it reported everything green.
    Also in CIM instances under XI Integration Server the following associations are present:
    - XI Contained Integration Server - associated with XI Domain 'Domain (host)'
    - XI Integration Server Logical Identity - associated with Business System 'INTEGRATION_SERVER_(SID)'
    - XI Sub-System viewed Application System - associated with BC System '(SID) on (host)'
    In Technical Landscape under Technical System Type PI the 'Application System' column is populated with '(SID) on (host)' for all entries except for the entry of type XI Domain.
    NB. I have deliberate obscured host and SID with (host) and (SID) respectively.
    The above entries all look correct to me and J2EE was restarted very recently so have not removed the entries as described in note 764176...
    Perhaps I could try to create the communication channel manually? Any idea which one uses the "SAP_HTTPServicePort" class?

  • More than one conequent in an association rule possible with SQL Developer?

    Dear experts
    Is it somehow possible to show more than one element in the consequence? According to the article http://docs.oracle.com/cd/B28359_01/datamine.111/b28129/algo_apriori.htm#autoId2 it seems not to be possible:
    "Oracle Data Mining supports association rules that have one or more items in the antecedent and a single item in the consequent."
    But is it somehow possible to (mathematically?) prove that e.g. xx, yy -> zz is the same as zz -> xx, yy? Or is there any other way to show more consequent items?
    For example I have the rule a,b,c -> d, e. How can I find this rule with the limitation of a single element in the consequence?
    Any help will be apreciated!
    Thanks in advance.

    Hi,
    The Oracle AR model only has one consequent.
    You can, however, write queries to extract out rules of interest that are filtered by both antecedent and consequent items along with other metrics.
    See the GET_ASSOCIATION_RULES pl/sql api doc: http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_datmin.htm#ARPLS65840
    Here is an example of such a query:
    SELECT t.rule_id rule_id,
      t.rule_support rule_support,
      t.rule_confidence rule_confidence,
      t.rule_lift rule_lift,
      t.antecedent,
      t.consequent,
      t.number_of_items rule_length,
      t.antecedent_support rule_antecedent_support,
      t.consequent_support rule_consequent_support
    FROM TABLE(dbms_data_mining.get_association_rules('SALES62992_AS', 100, NULL, .10, .01, 5, 1, dmsys.ora_mining_varchar2_nt('RULE_CONFIDENCE DESC', 'RULE_SUPPORT DESC'), DM_ITEMS(DM_ITEM('PROD_ID','23',NULL,NULL)), DM_ITEMS(DM_ITEM('PROD_ID','25',NULL,NULL), DM_ITEM('PROD_ID','26',NULL,NULL)),.10)) t
    ORDER BY rule_idThanks, Mark

  • Workflow rule transporting problem

    Hi,
      When i am trying to transport rule to from dev system to client system it is not getting copied can any body tell how to copy the rule data from dev to c system

    Hi!!!
    Thanks for ur prompt helps. Actually instead of OBJECTID I was passing the Obj-key and not the OBJECTID. This was creating problem. But still dont know why it was creating the prob.
    Anyways THANKS A LOT.
    Regards,
    Sudipto.

  • Association Rule : Settings in PL/SQL

    I've developed a model in ODM GUI for association rules.
    I'm now looking to develop the same in PL/SQL.
    I need to know how to specify the case id that has 2 attributes (CUST_ID and TIME_ID) and I have the PROD_ID as the ITEM ID. I have the following settings table and PLSQL
    BEGIN
    INSERT INTO assoc_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.algo_name, dbms_data_mining.ALGO_APRIORI_ASSOCIATION_RULES);
    INSERT into assoc_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.prep_auto, dbms_data_mining.prep_auto_on);
    INSERT into assoc_sample_settings (setting_name, setting_value) VALUES
    (ODMS_ITEM_ID_COLUMN_NAME, ‘PROD_ID’);
    END;
    DBMS_DATA_MINING.CREATE_MODEL(
    model_name => 'ASSOC_MODEL_2',
    mining_function => dbms_data_mining.association,
    data_table_name => 'SH.SALES',
    case_id_column_name => ‘CUST_ID, TIME_ID’,
    target_column_name => null,
    settings_table_name => 'assoc_sample_settings');
    Is this correct? for setting the CASE ID to 'CUST_ID, TIME_ID', is this correct and/or in the correct place
    Also the setting of the PROD_ID also correct?
    Do I need to use the ODMS_ITEM_VALUE_COLUMN_NAME setting ?

    Thank you for your reply, but it is still not working. There is the code that I have used for setting up and running. What is missing or incorrect with the following. The data is from the SH.SALES table.
    Settings Table
    BEGIN
    INSERT INTO assoc_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.algo_name, dbms_data_mining.ALGO_APRIORI_ASSOCIATION_RULES);
    INSERT into assoc_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.prep_auto, dbms_data_mining.prep_auto_off);
    INSERT into assoc_sample_settings (setting_name, setting_value) VALUES
    (dbms_data_mining.ODMS_ITEM_ID_COLUMN_NAME, ‘PROD_ID’);
    COMMIT;
    END;
    Create the view
    CREATE VIEW ASSOC_DATA_V AS (
    SELECT RANK() OVER (ORDER BY CUST_ID, TIME_ID) CASE_ID, t.*
    FROM SH.SALES t );
    Create the model
    BEGIN
    DBMS_DATA_MINING.CREATE_MODEL(
    model_name => 'ASSOC_MODEL_2',
    mining_function => DBMS_DATA_MINING.ASSOCIATION,
    data_table_name => 'ASSOC_DATA_V',
    case_id_column_name => ‘CASE_ID’,
    target_column_name => null,
    settings_table_name => 'assoc_sample_settings');
    END;
    BEGIN
    ERROR at line 1:
    ORA-40104: invalid training data for model build
    ORA-06512: at "SYS.DBMS_DATA_MINING", line 1798
    ORA-06512: at line 2
    Any ideas what is causing this?

  • Unable to find associated SLD for specified class(SAP_XIIntegration Directory)

    Hi All,
    We have installed PI 7.4  dual stack on windows platform. All Post Installation activities were completed succesfully. I am able to succesfully execute transactions: SLDCHECK, SXMB_ADM (check) etc.
    All RFC connections are also configured properly. SXI_CACHE working fine.
    But when I tried to create a communication channel it gives me following warning message:
    " Unable to find associated SLD element for specified class (source element: SAP_XIIntegrationDirectory "., CreationClassName,SAP_XIIntegrationDirectory,string, Name, directory.sxi.ict-vxi-65,string)target element class: SAP_XIIntegrationServer).
    Please suggest what needs to be done to solve this issue.
    Thanks
    Pawan

    Hi Pawan,
    SAP note #764176  should be applied. Before you do that, apply note #1117249 Incomplete Registration of PI components in SLD.
    Hopefully this will resolve the error.
    Regards,
    Naveen

Maybe you are looking for