| @@ 206-215 (lines=10) @@ | ||
| 203 | return raw_vectors, binary_vectors |
|
| 204 | ||
| 205 | ||
| 206 | def gen_binary_super_vectors(vectors, length): |
|
| 207 | raw_vectors = [] |
|
| 208 | binary_vectors = [] |
|
| 209 | dim = len(vectors[0]) |
|
| 210 | for i in range(length): |
|
| 211 | cnt_1 = np.count_nonzero(vectors[i]) |
|
| 212 | raw_vector = [1 for i in range(dim)] |
|
| 213 | raw_vectors.append(raw_vector) |
|
| 214 | binary_vectors.append(bytes(np.packbits(raw_vector, axis=-1).tolist())) |
|
| 215 | return raw_vectors, binary_vectors |
|
| 216 | ||
| 217 | ||
| 218 | def gen_int_attr(row_num): |
|
| @@ 200-209 (lines=10) @@ | ||
| 197 | return raw_vectors, binary_vectors |
|
| 198 | ||
| 199 | ||
| 200 | def gen_binary_super_vectors(vectors, length): |
|
| 201 | raw_vectors = [] |
|
| 202 | binary_vectors = [] |
|
| 203 | dim = len(vectors[0]) |
|
| 204 | for i in range(length): |
|
| 205 | cnt_1 = np.count_nonzero(vectors[i]) |
|
| 206 | raw_vector = [1 for i in range(dim)] |
|
| 207 | raw_vectors.append(raw_vector) |
|
| 208 | binary_vectors.append(bytes(np.packbits(raw_vector, axis=-1).tolist())) |
|
| 209 | return raw_vectors, binary_vectors |
|
| 210 | ||
| 211 | ||
| 212 | def gen_int_attr(row_num): |
|