WSO2 ML has a set of input/output adapters that are used to read/write data. You can extend WSO2 ML input/output adapters using a fragment bundle of org.wso2.carbon.ml.core bundle as explained below. For a sample custom adapter extension implementation, see ML Custom Adapter Extension.
WSO2 ML 1.0.0 does not support uploading datasets from storages defined by custom input adapter implementations.
- Create a Maven project.
- Copy the content in the
pom.xmlfile of the Git sample to the
pom.xmlfile of your project.
- Change the values of the
<artifactId>properties in the
pom.xmlfile as preferred.
Create a Java class in your project which implements the
MLInputAdapterinterface, by adding the content in the
You need to create a Java class in your project which implements the
MLOutputAdapterinterface for custom output adapter extensions.
read(String path)Java method with your custom input adapter implementation.
You need to override the
write(String outPath, InputStream in)Java method for custom output adapter implementations.
- Build the bundle by executing the following command:
mvn clean install
- Copy the built bundle to the
Add a new property element with a preferred name to the <
ML_HOME>/repository/conf/machine-learner.xmlfile corresponding to your new adapter as shown in the example below.
The property name for input/output adapters must end with the "
.in" and ".
out" suffixes accordingly.