Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 369. Weka Component
Since Camel 3.1
Only producer is supported
The Weka component provides access to the (Weka Data Mining) toolset.
Weka is tried and tested open source machine learning software that can be accessed through a graphical user interface, standard terminal applications, or a Java API. It is widely used for teaching, research, and industrial applications, contains a plethora of built-in tools for standard machine learning tasks, and additionally gives transparent access to well-known toolboxes such as scikit-learn, R, and Deeplearning4j.
Maven users will need to add the following dependency to their pom.xml
for this component:
369.1. URI format Link kopierenLink in die Zwischenablage kopiert!
weka://cmd
weka://cmd
369.2. Options Link kopierenLink in die Zwischenablage kopiert!
The Weka component supports 2 options, which are listed below.
Name | Description | Default | Type |
---|---|---|---|
lazyStartProducer (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean |
basicPropertyBinding (advanced) | Whether the component should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean |
The Weka endpoint is configured using URI syntax:
weka:command
weka:command
with the following path and query parameters:
369.2.1. Path Parameters (1 parameters): Link kopierenLink in die Zwischenablage kopiert!
Name | Description | Default | Type |
---|---|---|---|
command | Required The command to use. The value can be one of: filter, model, read, write, push, pop, version | Command |
369.2.2. Query Parameters (12 parameters): Link kopierenLink in die Zwischenablage kopiert!
Name | Description | Default | Type |
---|---|---|---|
lazyStartProducer (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel’s routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean |
basicPropertyBinding (advanced) | Whether the endpoint should use basic property binding (Camel 2.x) or the newer property binding with additional capabilities | false | boolean |
synchronous (advanced) | Sets whether synchronous processing should be strictly used, or Camel is allowed to use asynchronous processing (if supported). | false | boolean |
apply (filter) | The filter spec (i.e. Name Options) | String | |
build (model) | The classifier spec (i.e. Name Options) | String | |
dsname (model) | The named dataset to train the classifier with | String | |
folds (model) | Number of folds to use for cross-validation | 10 | int |
loadFrom (model) | Path to load the model from | String | |
saveTo (model) | Path to save the model to | String | |
seed (model) | An optional seed for the randomizer | 1 | int |
xval (model) | Flag on whether to use cross-validation with the current dataset | false | boolean |
path (write) | An in/out path for the read/write commands | String |
369.3. Karaf support Link kopierenLink in die Zwischenablage kopiert!
This component is not supported in Karaf
369.4. Message Headers Link kopierenLink in die Zwischenablage kopiert!
369.5. Samples Link kopierenLink in die Zwischenablage kopiert!
369.5.1. Read + Filter + Write Link kopierenLink in die Zwischenablage kopiert!
This first example shows how to read a CSV file with the file component and then pass it on to Weka. In Weka we apply a few filters to the data set and then pass it on to the file component for writing.
Here we do the same as above without use of the file component.
In this example, the client would provide the input path or some other supported type. Have a look at the WekaTypeConverters
for the set of supported input types.
369.5.2. Building a Model Link kopierenLink in die Zwischenablage kopiert!
When building a model, we first choose the classification algorithm to use and then train it with some data. The result is the trained model that we can later use to classify unseen data.
Here we train J48 with 10 fold cross-validation.
369.5.3. Predicting a Class Link kopierenLink in die Zwischenablage kopiert!
Here we use a Processor
to access functionality that is not directly available from endpoint URIs.
In case you come here directly and this syntax looks a bit overwhelming, you might want to have a brief look at the section about Nessus API Concepts.