Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Implementing Apriori Algorithm with XQuery

Implementing Apriori Algorithm with XQuery

Scheduled Pinned Locked Moved XML / XSL
helpalgorithmsxmlannouncement
1 Posts 1 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    helloworld2020
    wrote on last edited by
    #1

    Hi, I am trying to implement Apriori Algorithm(Mining Association Rules from XML Data) with XQuery. Unfortunately, I am not familiar with XQuery language. So, I need your help to fix the bug in the code given below

    xquery version "1.0";

    declare function apriori($l, $L, $minsup, $total, $src)
    {
    let $C := removeDuplicate(candidateGen($l))
    let $l := getLargeItemsets($C, $minsup, $total, $src)
    let $L := $l union $L
    return if (empty($l)) then
    $L
    else
    apriori($l, $L, $minsup, $total, $src)
    }

    let $src := doc(/transactions.xml)//items
    let $minsup := 0.4
    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 {$itemset}
    {$sup}
    )
    let $L := $l
    return {apriori($l, $L,$minsup, $total, $src)}

    Error: [DataDirect][XQuery][err:XPST0003]Error at line 14, column 1. Expected ";", but encountered "let" Thanks for any help :)

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups