Two-Class Averaged Perceptron

 

Updated: June 9, 2016

Creates an averaged perceptron binary classification model

You can use the Two-Class Averaged Perceptron module to create a machine learning model that uses the averaged perceptron algorithm.

Classification is a supervised learning method, and therefore requires a tagged dataset, which includes a label column.

You can train the model by providing the model and the tagged dataset as an input to Train Model or Tune Model Hyperparameters. The trained model can then be used to predict values for the new input examples.

The averaged perceptron method is an early and very simple version of a neural network.

In this supervised learning method, inputs are classified into several possible outputs based on a linear function, and then combined with a set of weights that are derived from the feature vector—hence the name "perceptron."

The simpler perceptron models are suited to learning linearly separable patterns, whereas neural networks (especially deep neural networks) can model more complex class boundaries. However, perceptrons are faster, and because they process cases serially, perceptrons can be used with continuous training.

  1. Add the Two-Class Averaged Perceptron module to the experiment.

  2. Specify how you want the model to be trained, by setting the Create trainer mode option.

    • Single Parameter. If you know how you want to configure the model, you can provide a specific set of values as arguments.

    • Parameter Range. If you are not sure of the best parameters, you can find the optimal parameters by specifying multiple values and using the Tune Model Hyperparameters module to find the optimal configuration. The trainer will iterate over multiple combinations of the settings you provided and determine the combination of values that produces the best model.

  3. For Learning rate, specify a value for the learning rate. The learning rate values controls the size of the step that is used in stochastic gradient descent each time the model is tested and corrected.

    By making the rate smaller, you test the model more often, with the risk that you will get stuck in a local plateau. By making the step larger, you can converge faster, at the risk of overshooting the true minima.

  4. For Maximum number of iterations, type the number of times you want the algorithm to examine the training data.

    Stopping early often provides better generalization. Increasing the number of iterations improves fitting, at the risk of overfitting.

  5. For Random number seed, optionally type an integer value to use as the seed.

    Use a seed if you want to ensure reproducibility of the experiment across runs.

  6. Select the Allow unknown categorical levels option to create a group for unknown values in the training and validation sets.

    If you deselect it, the model can accept only the values that are contained in the training data. In the former case, the model might be less precise for known values, but it can provide better predictions for new (unknown) values.

  7. Train the model.

    • If you set Create trainer mode to Single Parameter, connect a tagged dataset and the Train Model module.

    • If you set Create trainer mode to Parameter Range, connect a tagged dataset and train the model by using Tune Model Hyperparameters.

    System_CAPS_noteNote
    • If you pass a parameter range to Train Model, it will use only the first value in the parameter range list.

    • If you pass a single set of parameter values to the Tune Model Hyperparameters module, when it expects a range of settings for each parameter, it ignores the values and using the default values for the learner.

    • If you select the Parameter Range option and enter a single value for any parameter, that single value you specified will be used throughout the sweep, even if other parameters change across a range of values.

  8. When the model is trained, right-click the output of the Train Model module (or Tune Model Hyperparameters) to see a summary of the model's parameters, together with the feature weights learned from training.

For examples of how this learning algorithm is used, see this sample experiment in the Model Gallery:

For this model type, it is a best practice to normalize datasets before using them to train the classifier. For normalization options, see Normalize Data.

The averaged perceptron model is an early and simplified version of neural networks. As such, it works well on simple data sets when your goal is speed over accuracy. However, if you are not getting the desired results, you can try one of these models:

Name

Range

Type

Default

Description

Learning rate

>=double.Epsilon

Float

1.0

The initial learning rate for the Stochastic Gradient Descent optimizer.

Maximum number of iterations

>=1

Integer

10

The number of Stochastic Gradient Descent iterations to be performed over the training dataset.

Random number seed

Any

Integer

The seed for the random number generator used by the model. Leave it blank for the default.

Allow unknown categorical levels

Any

Boolean

True

If True, creates an additional level for each categorical column. Any levels in the test dataset that are not available in the training dataset are mapped to this additional level.

Name

Type

Description

Untrained model

ILearner interface

An untrained binary classification model that can be connected to the One-vs-All Multiclass, Train Model, or Cross-Validate Model modules.

Show: