Notebook 2: Association Rule Mining Flashcards

1
Q

Iterable

A

an object that can be interated over (like in a for loop)
ex: lists, tuples, sets, strings, dictionaries, ranges

-needs to implement __iter__()
-You can pass an iterable to functions like list(), tuple(), and for loops because they can be converted to an iterator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

iterator

A

An object used to perform the actual iteration.
-Implements both __iter__() (returns itself) and __next__() (returns the next value in the sequence or raises StopIteration when done).
-Iterators are stateful, meaning they remember their current position in the sequence.
-it’s a one time thing, need a new iterator once exhasted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

default dictionary

A

-requires a factory function to add a key when it does not exist (could be built in type like into or list, custom function)
-available from collections.defaultdict
-Python’s built-in dictionaries, you always to have to check whether a key exists before updating it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

itertools.permutations(iterable, r=None)

A

returns all possible ordered arrangements of r elements from the iterable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

itertools.combinations(iterable, r)

A

Generates all possible unordered combinations of r elements from the iterable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

association rule mining - confidence formula

A

confidence a -> b = support(A U B) / support (A)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

association rule mining - support

A

Support is how often an item (or itemset) shows up in the data

frequency or prevalence of an itemset (or items) in the dataset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

association rule mining - itemset

A

individual items in itemset

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

association rule mining - pair count

A

items in the itemset that appear together

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

dictionary comprehension formatting

A

{key_expression: value_expression for item in iterable if condition}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

range

A

range(start, stop, step)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
A

XOR or exlusive or

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

**

A

exponentiation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly