Skip to main content

findBestActions

findBestActions(targets, actionable, fixed?, constraints?, data?, targetImportance?): Promise<any>

Find the optimal actions for specified targets within the model. This function identifies the actions that are most likely to achieve desired targets.

Parameters

NameTypeDescription
targetsanyA dictionary of target outcomes to achieve.
actionablestring[]A list of actionable node names.
fixedObjectA dictionary of fixed nodes, if any.
constraintsObjectConstraints on the actions, if any.
data?anyThe data to use for the simulation, if any.
targetImportanceObjectImportance weights for the targets.

Returns

Promise<any>

A Promise resolving to the optimal actions.

Throws

If the server request fails or returns an unexpected status code.

Example

const model = await client.getModel('test-model');
const bestActions = await model.findBestActions(
{ 'y': 0.5 }, // Targets
['x'], // Actionable nodes
{ 'z': 0.5 }, // Fixed nodes
{ 'x': [0, 1] } // Constraints
);
console.log(bestActions);