The ml2wf project aims at helping Data Scientists to create their workflows in the BPMN standard from a FeatureModel and to capitalize on their knowledge from new BPMN workflows.
You can define your own constraints easily by commenting your workflow using a predefined and customizable syntax.
Once created and modified, the data scientist can merge the workflow into the FeatureModel and reuse it later.
Furthermore, it will allow data scientists to reduce meta-learning space and, over time, automate the creation of workflows tailored to a given time series anomaly detection problem.
ml2wf Machine Learning problem to Workflow
ml2wf generate -i file -o directory [-v level] ml2wf build -f FeatureModel -m metaDirectory -i instanceDirectory [-b] [-v level] ml2wf merge [--meta|--instance] -i file -o FeatureModel [-fb] [-v level] ml2wf save -i meta instance -o FeatureModel [-b] [-v level]
generate generate a workflow build build a FeatureModel from a set of workflows merge import a worklow in a FeatureModel save save a meta-workflow and its instance in a FeatureModel
-i, --input input path -o, --output output path -b, --backup backup the original FeatureModel file before any modification -f, --full process a full merge (including meta/instance relationship) -v, --verbose verbose mode (0=OFF,1=FATAL,2=ERROR,3=WARN,4=INFO,5=DEBUG,6=TRACE,7=ALL)
The default configuration is the following :
# constraints syntax (name : arity : symbol)
before : 2 : >>
after : 2 : <<
imp : 2 : =>
equ : 2 : <=>
conj : 2 : &
disj : 2 : |
not : 1 : !
Note that you can change this configuration modifying the configuration.cfg
under the ml2wf/config
directory
cd ml2wf
mvn clean package
The generated .jar
is located in the target
directory.
cd target
java -jar ml2wf.jar [command] [arguments]
Lets consider this generic workflow : my_wf.bpmn2 :
and this initial feature model : featureModel.xml :
We instantiate our generic workflow using the generate command :
java -jar ml2wf.jar generate -i my_wf.bpmn2 -o result/
Note that the resulting instance will be located in the
result
directory with the namemy_wf_instance.bpmn2
.
We change the tasks names which give us :
Note that we put some constraints on our tasks (in comments).
=> We now have 3 possibilities to create our knowledge database (FeatureModel).
We can merge our workflows in the FeatureModel using the merge command :
java -jar ml2wf.jar merge --meta -f -i my_wf.bpmn2 -o featureModel.xml
java -jar ml2wf.jar merge --instance -f -i result/my_wf_instance.bpmn2 -o featureModel.xml
Note that the -f argument will merge the meta/instance relationship
Beware a merge-instance only works properly if you use a generated workflow. Indeed in the XML (and not directly visible) <bpmn2:property id="Property_1" name="instance"/></bpmn2:task> gives information about the fact that the task must be considered as an instance, which will transform it into a concrete Feature. You can see the properties of a task by double-clicking on it.
We can save the meta and instance relationship in the FeatureModel using the save command :
java -jar ml2wf.jar save -i my_wf.bpmn2 result/my_wf_instance -o featureModel.xml
Note that like any other command, unless the --backup (-b) argument is specified, the original FeatureModel will be modified without backing it up.
We can build the FeatureModel using our existing workflows and the **build **command :
java -jar ml2wf.jar build -f featureModel.xml -m my_wf.bpmn2 -i result/
Note that the -m/-i argument can be a directory. In that case, all workflows in the given directory will be merged in the FeatureModel.
=> Here is the result :
Note that the workflows' constraints are translated into FeatureModel constraints in order to keep our knowledge database consistency.
Using the FeatureIDE, you now can select the wished tasks and it will automatically select the needed ones.