This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
| sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| # https://docs.docker.com/compose/install/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| from itertools import combinations | |
| import math | |
| import copy | |
| def euclid(a, b): | |
| """returns the Greatest Common Divisor of a and b""" | |
| a = abs(a) | |
| b = abs(b) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #-*- coding:utf-8 - *- | |
| def load_dataset(): | |
| "Load the sample dataset." | |
| return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]] | |
| def createC1(dataset): | |
| "Create a list of candidate item sets of size one." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def generateRules(L, support_data, min_confidence=0.7): | |
| """Create the association rules | |
| L: list of frequent item sets | |
| support_data: support data for those itemsets | |
| min_confidence: minimum confidence threshold | |
| """ | |
| rules = [] | |
| for i in range(1, len(L)): | |
| for freqSet in L[i]: |