Learn data science by doing data science! Data Science Using Python and R will get you plugged into the world’s two most widespread open-source platforms for data science: Python and R. Data science is hot. Bloomberg called data scientist “the hotte
首先导入包含apriori算法的mlxtend库,
pip install mlxtend
调用apriori进行关联规则分析,具体代码如下,其中数据集选取本博客 “机器学习算法——关联规则” 中的例子,可进行参考,设置最小支持度(min_support)为0.4,最小置信度(min_threshold)为0.1,
最小提升度(lift)为1.0,对数据集进行关联规则分析,
from mlxtend.preprocessing import TransactionEncoder
from m