xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 6KB
    文件類型: .py
    金幣: 1
    下載: 0 次
    發布日期: 2021-01-02
  • 語言: Python
  • 標簽: fp-growth??

資源簡介

基于《機器學習實戰》中FP-Growth的代碼修改形成的頻繁項集挖掘函數FP_Growth(),可顯示各頻繁項集的支持度;同時,還包括關聯規則發現函數findRules()。

資源截圖

代碼片段和文件信息

class?treeNode:
????def?__init__(self?nameValue?numOccur?parentNode):
????????self.name?=?nameValue
????????self.count?=?numOccur
????????self.nodelink?=?None
????????self.parent?=?parentNode??????#needs?to?be?updated
????????self.children?=?{}?
????
????def?inc(self?numOccur):
????????self.count?+=?numOccur
????????
????def?disp(self?ind=1):
????????print(‘??‘*ind?self.name?‘?‘?self.count)
????????for?child?in?self.children.values():
????????????child.disp(ind+1)

def?createTree(dataSet?minSup=1):?#create?FP-tree?from?dataset?but?don‘t?mine
????headerTable?=?{}
????#go?over?dataSet?twice
????for?trans?in?dataSet:#first?pass?counts?frequency?of?occurance
????????for?item?in?trans:
????????????headerTable[item]?=?headerTable.get(item?0)?+?dataSet[trans]
????f

評論

共有 條評論