Skip to Content
고성능 파이썬(2판)
book

고성능 파이썬(2판)

by 오현석, 미샤 고렐릭, 이안 오스발트
May 2021
Beginner to intermediate
528 pages
11h 27m
Korean
Hanbit Media, Inc.
Content preview from 고성능 파이썬(2판)
461
11
RAM 덜 사용하기
>>> "51
"
in
bloom
False
>>> num_false_positives = 0
>>> num_true_negatives = 0
>>> # 다음 수 중 어떤 것도 블룸 필터에 들어있으면 안 된다.
>>> # 필터에 들어있는 것을 하나 발견했다면, 그 응답은 거짓 양성이다.
>>>
for
i
in
range(51,10000):
....:
if
str(i)
in
bloom:
....: num_false_positives += 1
....:
else
:
....: num_true_negatives += 1
....:
>>> num_false_positives
54
>>> num_true_negatives
9895
>>> false_positive_rate = num_false_positives / float(10000 - 51)
>>> false_positive_rate
0.005427681173987335
>>> bloom.error
0.005
여러 원소의 집합을 하나로 합치기 위해 블룸 필터의 합집합을 구할 수도 있다.
>>> bloom_a = BloomFilter(200)
>>> bloom_b = BloomFilter(200)
>>>
for
i
in
range(50):
...: bloom_a.add(str(i))
...:
>>>
for
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
엑셀이 편해지는 파이썬

엑셀이 편해지는 파이썬

펠릭스 춤슈타인
핸즈온 비지도 학습

핸즈온 비지도 학습

강재원, 권재철, 안쿠르 A. 파텔

Publisher Resources

ISBN: 9791162244210