# first index of the inner list
# Contains base item and add item
pair = item[0]
items = [x for x in pair]
print("Rule: " + items[0] + " -> " + items[1])
#second index of the inner list
print("Support: " + str(item[1]))
#third index of the list located at 0th
#of the third index of the inner list
print("Confidence: " + str(item[2][0][2]))
print("Lift: " + str(item[2][0][3]))
print("=====================================")
import pandas as pd import numpy as np import matplotlib.pyplot as plt from apyori import apriori
store_data = pd.read_csv('D:/MSc_UofM/Data Mining/Project/DataSets/symptoms.tsv',delimiter="\t", header=None)
store_data.head()
count_row = store_data.shape[0] # gives number of row count count_col = store_data.shape[1] # gives number of col count
print(count_row)
print(count_col)
records = [] for i in range(0, 1519): records.append([str(store_data.values[i,j]) for j in range(0, 6)])
association_rules = apriori(records, min_support=0.0045, min_confidence=0.2, min_lift=3, min_length=2) association_results = list(association_rules)
print(len(association_results))
print(association_results[0])
for item in association_results:
output