Skip to content

File Model Input

This node is designed to take load in memory a machine learning model generated by an mllib pipeline. The file should be binary blob.

Warning

For the sake of keeping consistency across nodes name parameter, we have decided to keep file_path as the naming convention. As you can guess from the below example, what is expected is only the file name. The absolute or relative path of the model file should be set inside your spark_settings as shown in the example below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
    job: [
        { 
            type: file_model_input
            component: file_model_input
            settings: {
                file_path: model.bin
            }
            publish: [
                {
                    // Most probably you will use this model in a mllib node
                    // You must therefore name it model. This is explained in
                    // the mllib node documentation. 
                    stream: model
                }
            ]
        }
        spark_settings: {
            // Location of the input file. That path must be reachable
            // from where the spark runs. I.e. every spark node.
            // You can also use relative path like './AAPL.csv' as long
            // as you launch your pml in foreground mode from the same directory.
            // model.bin is located within the same directory as the pml you want to launch
            spark.files: ./model.bin
        }
    ]
}

Configuration(s)

  • file_path: String

    Description: [Required] The name of the file specified within spark.files parameter.