The DecisionProblem component provides the logic behind Decision Activities. Use this component to train the Process Execution Engines' classification algorithm and to request (evaluate) classifications.
Refer to Oracle BPM Studio Help for details about Decision Activities and how the Engine learns and classifies decisions.
The set of features (with their names and types) define the input to the decision problem. These are the individual measurable properties of the problem. For example, to classify the risk of a car insurance policy, the features may include the driver's age and zip code.
Choosing discriminating and independent features is key to the algorithm being successful in classification.
Use a numeric type when the feature falls in a numeric scale. Examples: age, salary, price. On numeric features, the classification algorithm assumes that proximity in feature values produces a similar classification.
Use a String type when the feature can take one of a relatively small set of predefined values. Examples: country, day of the week, gender. On String features, the classification algorithm does not assume any relationship between the different values of a feature.
This set of labels defines the possible decisions in the problem. For a given set of feature values, the classifier algorithm returns one of the class labels. For example, to classify the risk of a car insurance policy, the set of classes could be "LOW", "MEDIUM", "HIGH". The name of each class bears no meaning to the classification algorithm; they are just labels.
The storeExperience() method saves sample data for future training. This data samples are not "learned" by the classification function until the Engine runs its training procedure. This procedure runs periodically as part of the Engine's Disposer service (by default, every two days).
During the training procedure the Engine analyzes all previous experience (decisions recorded with storeExperience() and by human-made decisions from a Decision Activity) to adjust the classification function.
Once the system is trained, you can request a classification for a given set of feature values using the classify() method. This method returns a Map containing one entry per class; The key for each entry is the class label and the value is the probability value (a Real from 0 to 1) associated with that class.
The DecisionProblem component serves as the backend for Decision Activities. However, the component can be used independently of any process activity.
A decision problem is identified by its set of features (names and types) and classes. The order in the list of features and classes are defined is irrelevant (i.e. specifying classes "LOW", "MEDIUM", "HIGH" is equivalent to "HIGH", "LOW", "MEDIUM").
If DecisionProblem is initialized with a new set of features and classes (that is, a set not previously used in the current Process Execution Engine), a new problem is created.
If DecisionProblem is initialized with a set of features and classes previously used in the current Engine, then it is considered the same problem and the existing data is used.
The DecisionProblem component serves as the backend for Decision Activities.
Decision Activities use the form's input variables to define the features of the problem, and the form's buttons to define the classes (the "Cancel" button is also included in the set of classes).
The DecisionProblem component shares the statistical data with a Decision Activity only if the component is initialized with the exact same set of features and classes defined by the activity.
Multiple business processes, even from different projects, can access the same decision problem, sharing the training data.
The Process Execution Engine keeps track of which business processes use which decision problems. Every time a decision problem is used by a business process (from either a Decision Activity or using the DecisionProblem component) the Engine associates the business process with the decision problem.
When a project is un-deployed, the Engine discards all training data about decision problems that are no longer associated with any deployed business process.
riskInputs = ["age": "INT",
"zipcode": "STRING" ]
riskOutputs = [ "Low", "Medium", "High" ]
policyRiskDecision = DecisionProblem(features : riskInputs,
classes : riskOutputs)
storeExperience policyRiskDecision
using features = ["age": 18, "zipcode": "75287" ],
classification = "High"
storeExperience policyRiskDecision
using features = ["age": 21, "zipcode": "75287" ],
classification = "Medium"
storeExperience policyRiskDecision
using features = ["age": 26, "zipcode": "75287" ],
classification = "Low"
storeExperience policyRiskDecision
using features = ["age": 21, "zipcode": "02101" ],
classification = "High"
storeExperience policyRiskDecision
using features = ["age": 25, "zipcode": "02101" ],
classification = "Medium"
riskInputs = ["age": "INT",
"zipcode": "STRING" ]
riskOutputs = [ "Low", "Medium", "High" ]
policyRiskDecision = DecisionProblem(features : riskInputs,
classes : riskOutputs)
forceTraining policyRiskDecision
using max Records = 1000
riskInputs = ["age": "INT",
"zipcode": "STRING" ]
riskOutputs = [ "Low", "Medium", "High" ]
policyRiskDecision = DecisionProblem(features : riskInputs,
classes : riskOutputs)
classify policyRiskDecision
using features = ["age": 29, "zipcode": "02101" ]
returning riskProbabilities = probabilities
for risk in riskProbabilities do
display "Probability of "+risk+" risk is "+riskProbabilities[risk]
end
// Example output:
//
// Probability of High risk is 0.5
// Probability of Medium risk is 0.3
// Probability of Low risk is 0.2