(csv_row, D)
| 50 | # OUTPUT: |
| 51 | # x: a list of indices that its value is 1 |
| 52 | def get_x(csv_row, D): |
| 53 | x = [0] # 0 is the index of the bias term |
| 54 | for key, value in csv_row.items(): |
| 55 | index = int(value + key[1:], 16) % D # weakest hash ever ;) |
| 56 | x.append(index) |
| 57 | return x # x contains indices of features that have a value of 1 |
| 58 | |
| 59 | |
| 60 | # C. Get probability estimation on x |
no outgoing calls
no test coverage detected