Skip to content

Package: machine_learning

Machine learning (ML) algorithms and related nodes.

The majority of these nodes are one-stop shops that can be inserted after data has been appropriately preprocessed and labeled, and output predictions, but others fulfill other special management roles. The most important specialty nodes are Assign Targets, Accumulate Calibration Data, Measure Loss, and Crossvalidation. The most important classic ML techniques are Logistic Regression, Linear Discriminant Analysis and Convex Model (for advanced uses), and some of the Classification and Regression nodes for categorical or continuous-valued outputs, respectively. Most machine learning methods expect their incoming data packets to have an instance axis that indexes the observations and optionally one or more other axes (e.g,, feature, space, time) to make up the input data space. Most ML methods will output categorical or continuous-valued predictions that take on a specific format in NeuroPype. The most common case are classifier predictions that will have an instance axis and a feature axis with the number of features equal to the number of classes, where each feature has the probability of the corresponding class being the correct label for the instance. Importantly, nodes implementing learning algorithms are generally stateful, meaning that they can adapt themselves to the data that they receive and then use their internal state (model) to process subsequent data. Typically the adaptation happens the first time the node is invoked on a data packet, which is then expected to not only have an instance axis, but also that the instance axis payload (its .data array) has ground-truth training labels in it, which are usually expected in a field named 'TargetValue'. Then the node will train itself on that packet and remain fixed for the remainder of the node's life cycle, (although it is possible to reconfigure nodes to retrain themselves on each subsequent packet). Note that when ML nodes are used in conjunction with graph-accepting nodes such as in function definitions (FunctionDef/FunctionCall) or in loop bodies (e.g., with ForEach), some of the latter nodes will clear the state on each subsequent update unless configured to behave in a stateful or "materialized" way). A special case is the Crossvalidation node, which will, for each CV fold, reset the state of the ML node, then pass in the training data (and get training predictions out), and then pass in the test data (and get test predictions out for the current fold), then reset the state again for the next fold. The category also includes several key ML workflow ndoes such as for assigning target labels from event markers or other per-instance conditions (AssignTargets), quantifying a loss (or negative score) via MeasureLoss.

Nodes in this package: