Repository navigation
Expand file tree
/
Copy pathcppbloom.pyi
More file actions
91 lines (79 loc) · 2.02 KB
/
Copy pathcppbloom.pyi
File metadata and controls
91 lines (79 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from typing import List, Sequence
import numpy as np
import numpy.typing as npt
def extract_basic_features(
strings: List[str],
vector_size: int
) -> npt.NDArray[np.float32]: ...
def extract_sparse_ngrams(
strings: Sequence[str],
num_bins: int,
) -> tuple[
npt.NDArray[np.float32],
npt.NDArray[np.int32],
npt.NDArray[np.int32],
]: ...
def extract_token_hashes(
strings: Sequence[str],
num_bins: int,
) -> tuple[
npt.NDArray[np.float32],
npt.NDArray[np.int32],
npt.NDArray[np.int32],
]: ...
class BloomFilter:
def __init__(self, element_count: int, fpr: float) -> None: ...
def add(self, data: str) -> None: ...
def contains(self, data: str) -> bool: ...
def __contains__(self, data: str) -> bool: ...
def memory_cost(self) -> int: ...
class LearnedBloomFilter:
def __init__(
self,
w: List[float],
b: float,
t: float,
bins: int,
backup_size: int,
backup_fpr: float
) -> None: ...
def add_to_backup(self, key: str) -> None: ...
def contains(self, key: str) -> bool: ...
def __contains__(self, key: str) -> bool: ...
def getMemoryCost(self) -> float: ...
class Result:
insertCount: int
negativeQueryCount: int
truePositive: int
falsePositive: int
trueNegative: int
falseNegative: int
timeTakenInNs: int
memoryNeeded: int
def __repr__(self) -> str: ...
class Evaluator:
def __init__(self) -> None: ...
def generate_random_strings(
self,
count: int,
maxLenOfStrings: int,
path: str
) -> List[str]: ...
def run_single_experiment(
self,
elementCount: int,
fpr: float,
pathReal: str,
pathFake: str
) -> Result: ...
def run_learned_experiment(
self,
weights: List[float],
bias: float,
threshold: float,
num_bins: int,
backup_size: int,
backup_fpr: float,
pathReal: str,
pathFake: str
) -> Result: ...