Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
maxLevel3

...

  1. If you already executed a sample before, execute the following command to remove the databases created: rm -rf repository/database/WSO2ML_DB.*

  2. Navigate to <ML_HOME>/samples/rest-api/decision-tree/ directory using the CLI.

    Info

    <ML_HOME> refers to the downloaded product-ml directory with the source code of the product

  3. Execute the following command to execute the sample: sh model-generation.sh

Output of the sample

 If  Once the sample is successfully executed successfully, you obtain the following output is as follows.

  1. By default, the sample generates the model in the /tmp/ directory of your machine. For example, the generated file is in the following format denoting the date and time when it was generated: model.1.2015-03-20_13:29:10

    Info

    You can change the location where the output model file is saved, by defining the folder path of the required location for the value of the location element in the <ML_HOME>/samples/rest-api/decision-tree/create-model-storage file as shown below.

    Code Block
    languagetext
    {
    "type" : "file",
    "location" : "/tmp"
    }
  2. The sample executes the generated model on the <ML_HOME>/samples/rest-api/decision-tree/prediction-test data set, and it prints the value [0.0] as the prediction result In the CLI logs.