UNPKG

bigml-nodered

Version:

BigML bindings for Nodered

443 lines (399 loc) 18.1 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-prediction', { category: 'BigML', color: '#454957', defaults: {"default_numeric_value":{"value":"none"},"confidence":{"value":false},"dataset":{"value":""},"probability":{"value":true},"newline":{"value":"LF"},"node_id":{"value":true},"vote_counts":{"value":false},"fields_map":{"value":""},"tags":{"value":""},"confidences":{"value":true},"name":{"value":"batchprediction","required":true},"reify":{"value":false},"vote_count":{"value":false},"probabilities":{"value":false},"excluded_fields":{"value":""},"missing_strategy":{"value":0},"output_dataset":{"value":true},"prediction_name":{"value":""},"votes":{"value":false},"operating_kind":{"value":null},"confidence_name":{"value":""},"category":{"value":0},"output_fields":{"value":""},"probability_name":{"value":""},"all_fields":{"value":false},"vote_count_name":{"value":""},"separator":{"value":","},"webhook":{"value":""},"importance":{"value":true},"operating_point":{"value":""},"header":{"value":true},"description":{"value":""},"input_fields":{"value":""}}, inputs:1, outputs:1, inputLabels: '[model,dataset]', outputLabels: 'batchprediction', icon: 'icon_batchprediction.png', label: function() { return this.name || 'Batch Prediction'; }, labelStyle: function() { return this.name?"bigml_node_label":""; }, }); </script> <script type="text/x-red" data-template-name="batch-prediction"> <div class="form-row"> <label for="node-input-name"> <i class="icon-tag"></i> Name </label> <input type=text id=node-input-name value='batchprediction'> </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-confidence"> <i class="icon-tag"></i> Confidence </label> <input type=checkbox id=node-input-confidence value='false'> </div> <div class="form-row"> <label for="node-input-confidence_name"> <i class="icon-tag"></i> Confidence name </label> <input type=text id=node-input-confidence_name placeholder='Confidence' > </div> <div class="form-row"> <label for="node-input-confidences"> <i class="icon-tag"></i> Confidences </label> <input type=checkbox id=node-input-confidences value='true'> </div> <div class="form-row"> <label for="node-input-dataset"> <i class="icon-tag"></i> Dataset </label> <input type=text id=node-input-dataset placeholder='dataset/4f66a80803ce8940c5000006' > </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-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-importance"> <i class="icon-tag"></i> Importance </label> <input type=checkbox id=node-input-importance 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-missing_strategy"> <i class="icon-tag"></i> Missing strategy </label> <select id=node-input-missing_strategy value='0'><option value=0>Last prediction</option> <option value=1>Proportional</option></select> </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-node_id"> <i class="icon-tag"></i> Node ID </label> <input type=checkbox id=node-input-node_id value='true'> </div> <div class="form-row"> <label for="node-input-operating_kind"> <i class="icon-tag"></i> Operating kind </label> <select id=node-input-operating_kind ><option value=confidence>Confidence</option> <option value=probability>Probability</option> <option value=votes>Votes</option></select> </div> <div class="form-row"> <label for="node-input-operating_point"> <i class="icon-tag"></i> Operating point </label> <input type=text id=node-input-operating_point placeholder='{ "kind": "probability", "positive_class": "Iris-setosa", "threshold": 0.42 }' > </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-prediction_name"> <i class="icon-tag"></i> Prediction name </label> <input type=text id=node-input-prediction_name placeholder='Prediction' > </div> <div class="form-row"> <label for="node-input-probabilities"> <i class="icon-tag"></i> Probabilities </label> <input type=checkbox id=node-input-probabilities value='false'> </div> <div class="form-row"> <label for="node-input-probability"> <i class="icon-tag"></i> Probability </label> <input type=checkbox id=node-input-probability value='true'> </div> <div class="form-row"> <label for="node-input-probability_name"> <i class="icon-tag"></i> Probability name </label> <input type=text id=node-input-probability_name placeholder='Probabiity' > </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-vote_count"> <i class="icon-tag"></i> Vote count </label> <input type=checkbox id=node-input-vote_count value='false'> </div> <div class="form-row"> <label for="node-input-vote_count_name"> <i class="icon-tag"></i> Vote count name </label> <input type=text id=node-input-vote_count_name placeholder='Votes' > </div> <div class="form-row"> <label for="node-input-vote_counts"> <i class="icon-tag"></i> Vote counts </label> <input type=checkbox id=node-input-vote_counts value='false'> </div> <div class="form-row"> <label for="node-input-votes"> <i class="icon-tag"></i> Votes </label> <input type=checkbox id=node-input-votes value='false'> </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-prediction"> <p>Create BigML Batch Prediction.</p> <h3>Details</h3> <p>This node support all inputs defined in <a href='https://bigml.com/api/batch-predictions' target=blank>BigML REST API</a>. By default, it expects to receive a <code>[model,dataset]</code> input (see below for more details) and it will output the <code>batchprediction</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>Confidence <span class="property-type">:boolean</span> </dt> <dd>Whether the confidence for each prediction for the model or non-boosted ensemble should be added to the each csv file.</dd> <dt>Confidence name <span class="property-type">:text</span> </dt> <dd>The name of the column in the header of the generated file containing the confidence when a model or non-boosted ensemble is used to create the batch predicition.</dd> <dt>Confidences <span class="property-type">:boolean</span> </dt> <dd>Whether to include a column per class with its corresponding confidence for the batch prediction for the classification task.</dd> <dt>Dataset <span class="property-type">:text</span> </dt> <dd>A valid dataset/id</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>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>Importance <span class="property-type">:boolean</span> </dt> <dd>Whether to include a column for each of the field importances for model, ensemble, and fusion predictions.</dd> <dt>Input fields <span class="property-type">:text</span> </dt> <dd>Specifies the fields to be included in the dataset.</dd> <dt>Missing strategy <span class="property-type">:select</span> </dt> <dd>Specifies the method that should be used for the model, ensemble or fusion when a missing split is found.</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>Node ID <span class="property-type">:boolean</span> </dt> <dd>Whether a column containing a unique id for the final tree node when making a prediction should be added.</dd> <dt>Operating kind <span class="property-type">:select</span> </dt> <dd>The operating threshold kind corresponding to the confusion matrix to perform the evaluation.</dd> <dt>Operating point <span class="property-type">:text</span> </dt> <dd>The specification of an operating point for classification problems.</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>Prediction name <span class="property-type">:text</span> </dt> <dd>The name of the column in the header of the generated file for the prediction.</dd> <dt>Probabilities <span class="property-type">:boolean</span> </dt> <dd>Whether to include the predicted class and all other possible class values for the batch prediction for the classification task.</dd> <dt>Probability <span class="property-type">:boolean</span> </dt> <dd>Whether the probability for each prediction for the classification task should be added.</dd> <dt>Probability name <span class="property-type">:text</span> </dt> <dd>The name of the column in the header of the generated file containing the probability for the classification task.</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>Vote count <span class="property-type">:boolean</span> </dt> <dd>Whether the vote_count for each prediction for the classification ensemble task should be added.</dd> <dt>Vote count name <span class="property-type">:text</span> </dt> <dd>The name of the column in the header of the generated file containing the vote_count for the ensemble classification task.</dd> <dt>Vote counts <span class="property-type">:boolean</span> </dt> <dd>Whether the vote_counts, a list of fractions of votes, one per category for the batch prediction for the ensemble classification task should be added.</dd> <dt>Votes <span class="property-type">:boolean</span> </dt> <dd>Whether to include a column for each of the individual model predictions for the non-boosted ensemble.</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>batchprediction</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>