def predict(self, float_state_features, int_state_features, actions): """ Returns values for each state/action pair. :param float_state_features states as list of feature -> float value dict :param int_state_features states as list of feature -> int value dict :param actions actions as list of feature -> value dict """ float_examples = [] for i in range(len(float_state_features)): float_examples.append({**float_state_features[i], **actions[i]}) if int_state_features is None: return RLPredictor.predict(self, float_examples) return RLPredictor.predict(self, float_examples, int_state_features)
def predict(self, states, actions): """ Returns values for each state/action pair :param states states as list of feature -> value dict :param actions actions as list of feature -> value dict """ examples = [] for i in range(len(states)): examples.append({**states[i], **actions[i]}) return RLPredictor.predict(self, examples)