hello i have problem like this picture, any solutions with my problem
code :
from apyori import apriori
rules = apriori(transactions, min_support = sp, min_confidence = cf, min_lift = lt, min_length = 2)
if st.button('Process'):
aturan = list(rules)
def gen(aturan):
lhs = [tuple(result[2][0][0])[0] for result in aturan]
rhs = [tuple(result[2][0][1])[0] for result in aturan]
supports = [result[1] for result in aturan]
confidences = [result[2][0][2] for result in aturan]
lifts = [result[2][0][3] for result in aturan]
return list(zip(lhs, rhs, supports, confidences, lifts))
resultsinDataFrame = pd.DataFrame(gen(aturan), columns = ['Left Hand Side', 'Right Hand Side', 'Support', 'Confidence', 'Lift'])
st.write(resultsinDataFrame)