UNPKG

bigml-nodered

Version:

BigML bindings for Nodered

287 lines (257 loc) 11.2 kB
<style> .bigml_node_label { fill: white; } #palette-BigML .palette_node { color: white; } #red-ui-palette-BigML .red-ui-palette-label { color: white; } </style> <script type="text/javascript"> RED.nodes.registerType('batch-centroid', { category: 'BigML', color: '#454957', defaults: {"default_numeric_value":{"value":"none"},"centroid_name":{"value":""},"distance_name":{"value":""},"newline":{"value":"LF"},"fields_map":{"value":""},"tags":{"value":""},"name":{"value":"batchcentroid","required":true},"reify":{"value":false},"excluded_fields":{"value":""},"distance":{"value":false},"output_dataset":{"value":true},"category":{"value":0},"output_fields":{"value":""},"all_fields":{"value":false},"separator":{"value":","},"webhook":{"value":""},"header":{"value":true},"description":{"value":""},"input_fields":{"value":""}}, inputs:1, outputs:1, inputLabels: '[cluster,dataset]', outputLabels: 'batchcentroid', icon: 'icon_batchcentroid.png', label: function() { return this.name || 'Batch Centroid'; }, labelStyle: function() { return this.name?"bigml_node_label":""; }, }); </script> <script type="text/x-red" data-template-name="batch-centroid"> <div class="form-row"> <label for="node-input-name"> <i class="icon-tag"></i> Name </label> <input type=text id=node-input-name value='batchcentroid'> </div> <div class="form-row"> <label for="node-input-description"> <i class="icon-tag"></i> Description </label> <input type=text id=node-input-description > </div> <div class="form-row"> <label for="node-input-all_fields"> <i class="icon-tag"></i> All fields </label> <input type=checkbox id=node-input-all_fields value='false'> </div> <div class="form-row"> <label for="node-input-centroid_name"> <i class="icon-tag"></i> Centroid name </label> <input type=text id=node-input-centroid_name placeholder='Centroid' > </div> <div class="form-row"> <label for="node-input-default_numeric_value"> <i class="icon-tag"></i> Default numeric value </label> <select id=node-input-default_numeric_value value='none'><option value=none>None</option> <option value=mean>Mean</option> <option value=median>Median</option> <option value=minimum>Minimum</option> <option value=maximum>Maximum</option> <option value=zero>Zero</option></select> </div> <div class="form-row"> <label for="node-input-distance"> <i class="icon-tag"></i> Distance </label> <input type=checkbox id=node-input-distance value='false'> </div> <div class="form-row"> <label for="node-input-distance_name"> <i class="icon-tag"></i> Distance name </label> <input type=text id=node-input-distance_name placeholder='Distance' > </div> <div class="form-row"> <label for="node-input-excluded_fields"> <i class="icon-tag"></i> Excluded fields </label> <input type=text id=node-input-excluded_fields placeholder='["000000", "000002"]' > </div> <div class="form-row"> <label for="node-input-fields_map"> <i class="icon-tag"></i> Fields map </label> <input type=text id=node-input-fields_map placeholder='{"000000":"00000a", "000001":"000002", "000002":"000001", "000003":"000020", "000004":"000004"}' > </div> <div class="form-row"> <label for="node-input-header"> <i class="icon-tag"></i> Header </label> <input type=checkbox id=node-input-header value='true'> </div> <div class="form-row"> <label for="node-input-input_fields"> <i class="icon-tag"></i> Input fields </label> <input type=text id=node-input-input_fields placeholder='["000000", "000003"]' > </div> <div class="form-row"> <label for="node-input-newline"> <i class="icon-tag"></i> Newline </label> <select id=node-input-newline value='LF'><option value=LF>Lf</option> <option value=CRLF>Crlf</option></select> </div> <div class="form-row"> <label for="node-input-output_dataset"> <i class="icon-tag"></i> Output dataset </label> <input type=checkbox id=node-input-output_dataset value='true'> </div> <div class="form-row"> <label for="node-input-output_fields"> <i class="icon-tag"></i> Output fields </label> <input type=text id=node-input-output_fields placeholder='["000001", "000003", "price"]' > </div> <div class="form-row"> <label for="node-input-separator"> <i class="icon-tag"></i> Separator </label> <input type=text id=node-input-separator value=','> </div> <div class="form-row"> <label for="node-input-tags"> <i class="icon-tag"></i> Tags </label> <input type=text id=node-input-tags placeholder='["A tag", "Another Tag"]' > </div> <div class="form-row"> <label for="node-input-category"> <i class="icon-tag"></i> Category </label> <select id=node-input-category value='0'><option value=5>5</option> <option value=Healthcare>Healthcare</option></select> </div> <div class="form-row"> <label for="node-input-webhook"> <i class="icon-tag"></i> Webhook </label> <input type=text id=node-input-webhook > </div> <div class="form-row"> <label for="node-input-reify"> <i class="icon-tag"></i> Reify </label> <input type=checkbox id=node-input-reify value='false'> </div> </script> <script type="text/html" data-help-name="batch-centroid"> <p>Create BigML Batch Centroid.</p> <h3>Details</h3> <p>This node support all inputs defined in <a href='https://bigml.com/api/batch-centroids' target=blank>BigML REST API</a>. By default, it expects to receive a <code>[cluster,dataset]</code> input (see below for more details) and it will output the <code>batchcentroid</code> field of the created resource. </p> <p>However, you can override default inputs and outputs by defining the node port label so they match the desired input or output as specified below.</p> <p>Only when the node is used with the <code>reify</code> option enabled, it will actually hit BigML and do its work there. This generally means some resources will be created and sent through as node outputs.</p> <p>When the node is used with the <code>reify</code>option disabled, it will generate WhizzML code and send it through to the next node in the flow without hitting BigML. All WhizzML code created by this node (and others) when not in <code>reify</code> mode is accumulated and executed as a single WhizzML script by the first downstream <code>reified</code> node.</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>Name <span class="property-type">:text</span> </dt> <dd>A name for this node.</dd> <dt>Description <span class="property-type">:text</span> </dt> <dd></dd> <dt>All fields <span class="property-type">:boolean</span> </dt> <dd>Whether all the fields from the dataset should be part of the generated csv file.</dd> <dt>Centroid name <span class="property-type">:text</span> </dt> <dd>The name of the column in the header of the generated file for the centroid.</dd> <dt>Default numeric value <span class="property-type">:select</span> </dt> <dd>Substitute missing numeric values across all the numeric fields in the dataset.</dd> <dt>Distance <span class="property-type">:boolean</span> </dt> <dd>Whether the distance for each centroid should be added to the csv file.</dd> <dt>Distance name <span class="property-type">:text</span> </dt> <dd>The name of the column in the header of the generated file containing the distance.</dd> <dt>Excluded fields <span class="property-type">:text</span> </dt> <dd>Specifies the fields that won't be included in the dataset.</dd> <dt>Fields map <span class="property-type">:text</span> </dt> <dd>A dictionary of identifiers of the fields to use from the model under test mapped to their corresponding identifiers in the input dataset.</dd> <dt>Header <span class="property-type">:boolean</span> </dt> <dd>Whether the csv file should have a header with the name of each field.</dd> <dt>Input fields <span class="property-type">:text</span> </dt> <dd>Specifies the fields to be included in the dataset.</dd> <dt>Newline <span class="property-type">:select</span> </dt> <dd>The new line character that you want to get as line break in the generated csv file.</dd> <dt>Output dataset <span class="property-type">:boolean</span> </dt> <dd>Whether a dataset with the results should be automatically created or not.</dd> <dt>Output fields <span class="property-type">:json</span> </dt> <dd>Specifies the fields to be included in the csv file. It can be a list of field ids or names.</dd> <dt>Separator <span class="property-type">:text</span> </dt> <dd>The separator that you want to get between fields in the generated csv file.</dd> <dt>Tags <span class="property-type">:text</span> </dt> <dd>A list of tags to identify the resource.</dd> <dt>Category <span class="property-type">:select</span> </dt> <dd></dd> <dt>Webhook <span class="property-type">:text</span> </dt> <dd>A webhook url and an optional secret phrase.</dd> <dt>Reify <span class="property-type">:boolean</span> </dt> <dd>Execute the WhizzML code generated at this (and upstream) node(s). You need to enable this option if you want to get a result from your flow that you can pass to a non-BigML node.</dd> </dl> <h3>Outputs</h3> <ol class="node-ports"> <dl class="message-properties"> <dt>payload <span class="property-type">string or JSON</span></dt> <dd>the <code>batchcentroid</code> of the created BigML entity.</dd> <dt>whizzml <span class="property-type">string</dt> <dd>(only for <code>reified</code> nodes) the generated WhizzML code which is fed into the next node. <dt>wzStack <span class="property-type">object</dt> <dd>(only for <code>reified</code> nodes) private. </dl> </ol> </script>