python数据挖掘orange

http://blog.csdn.net/pipisorry/article/details/52845804

orange的安装

linux下的安装

先安装依赖pyqt4[PyQt教程 - pythonQt的安装和配置及版本间差异]

pip install orange3

检查是否安装成功

import Orange

运行GUI界面

alias orange 'python3 -m Orange.canvas &'

安装出错

build/temp.linux-x86_64-3.5/_openssl.c:433:30: fatal error: openssl/opensslv.h: No such file or directory

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Failed building wheel for cryptography
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

解决:sudo apt-get install -y libssl-dev

皮皮blog



Orange教程

等有时间了再写。。。

[orange Documentation]


皮皮blog

from: http://blog.csdn.net/pipisorry/article/details/52845804

ref: [orange:Data Mining Fruitful and Fun]


关联规则是数据挖掘中的一种常见技术,用于发现数据集中的项之间的关系。Python作为一种流行的编程语言,也提供了许多用于关联规则挖掘的库和工具。以下是Python中进行关联规则挖掘的一些常用库和方法: 1. Apriori算法:Apriori算法是一种常见的关联规则挖掘算法,它可以用于发现数据集中的频繁项集。在Python中,可以使用mlxtend库中的apriori函数来实现Apriori算法。例如: ```python from mlxtend.frequent_patterns import apriori # 构建数据集 dataset = [['apple', 'beer', 'rice', 'chicken'], ['apple', 'beer', 'rice'], ['apple', 'beer'], ['apple', 'banana', 'orange', 'lemon', 'peach', 'pineapple'], ['banana', 'orange', 'lemon', 'peach', 'pineapple']] # 使用Apriori算法查找频繁项集 frequent_itemsets = apriori(dataset, min_support=0.5, use_colnames=True) # 输出频繁项集 print(frequent_itemsets) ``` 2. FP-growth算法:FP-growth算法是另一种常见的关联规则挖掘算法,它可以用于发现数据集中的频繁项集。在Python中,可以使用pyfpgrowth库来实现FP-growth算法。例如: ```python import pyfpgrowth # 构建数据集 dataset = [['apple', 'beer', 'rice', 'chicken'], ['apple', 'beer', 'rice'], ['apple', 'beer'], ['apple', 'banana', 'orange', 'lemon', 'peach', 'pineapple'], ['banana', 'orange', 'lemon', 'peach', 'pineapple']] # 使用FP-growth算法查找频繁项集 patterns = pyfpgrowth.find_frequent_patterns(dataset, 2) # 输出频繁项集 print(patterns) ``` 3. 关联规则挖掘:在找到频繁项集之后,可以使用关联规则挖掘来发现项之间的关系。在Python中,可以使用mlxtend库中的association_rules函数来实现关联规则挖掘。例如: ```python from mlxtend.frequent_patterns import apriori from mlxtend.frequent_patterns import association_rules # 构建数据集 dataset = [['apple', 'beer', 'rice', 'chicken'], ['apple', 'beer', 'rice'], ['apple', 'beer'], ['apple', 'banana', 'orange', 'lemon', 'peach', 'pineapple'], ['banana', 'orange', 'lemon', 'peach', 'pineapple']] # 使用Apriori算法查找频繁项集 frequent_itemsets = apriori(dataset, min_support=0.5, use_colnames=True) # 使用关联规则挖掘查找项之间的关系 rules = association_rules(frequent_itemsets, metric="confidence", min_threshold=0.7) # 输出关联规则 print(rules) ```
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值