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

Function get_p

Logistic-Regression/citreo.py:66–70  ·  view source on GitHub ↗
(x, w)

Source from the content-addressed store, hash-verified

64# OUTPUT:
65# probability of p(y = 1 | x; w)
66def get_p(x, w):
67 wTx = 0.
68 for i in x: # do wTx
69 wTx += w[i] * 1. # w[i] * x[i], but if i in x we got x[i] = 1.
70 return 1. / (1. + exp(-max(min(wTx, 20.), -20.))) # bounded sigmoid
71
72
73# D. Update given model

Callers 1

citreo.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected