BaşlayınÜcretsiz Başlayın

Using multi-metric filtering to cross-promote books

As a final request, the founder of the ebook selling start-up asks you to perform additional filtering. Your previous attempt returned 82 rules, but she wanted only one. The rules dataset has again been made available in the console. Finally, Zhang's metric has been computed for you and included in the rules DataFrame under the column header zhang.

Bu egzersiz

Market Basket Analysis in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Set the lift threshold to be greater than 1.5.
  • Use a conviction threshold of 1.0.
  • Require Zhang's metric to be greater than 0.65.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Set the lift threshold to 1.5
rules = rules[rules['____'] > ____]

# Set the conviction threshold to 1.0
rules = rules[____]

# Set the threshold for Zhang's rule to 0.65
rules = ____

# Print rule
print(rules[['antecedents','consequents']])
Kodu Düzenle ve Çalıştır