Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/lazyprogrammer/machine_learning_examples
/ build_state
Function
build_state
rl2/cartpole/q_learning_bins.py:26–27 ·
view source on GitHub ↗
(features)
Source
from the content-addressed store, hash-verified
24
# Ex.
25
# build_state([1,2,3,4,5]) -> 12345
26
def
build_state(features):
27
return
int(
""
.join(map(
lambda
feature: str(int(feature)), features)))
28
29
def
to_bin(value, bins):
30
return
np.digitize(x=[value], bins=bins)[0]
Callers
1
transform
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected