MCPcopy Index your code
hub / github.com/ujjwalkarn/DataSciencePython / get_x

Function get_x

Logistic-Regression/citreo.py:52–57  ·  view source on GitHub ↗
(csv_row, D)

Source from the content-addressed store, hash-verified

50# OUTPUT:
51# x: a list of indices that its value is 1
52def 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

Callers 2

citreo_code_v2.pyFile · 0.85
citreo.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected