WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

PerceptronModel []

represents a perceptron net for prediction.

PerceptronModel [hpars]

uses the custom hyperparameters hpars.

PerceptronModel [hpars,vars]

uses the provided variables vars.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Hyperparameters  
"Depth"  
"Width"  
"Activation"  
Variables  
Evaluation  
Information  
Fitting  
See Also
Related Guides
History
Cite this Page

PerceptronModel []

represents a perceptron net for prediction.

PerceptronModel [hpars]

uses the custom hyperparameters hpars.

PerceptronModel [hpars,vars]

uses the provided variables vars.

Details

  • PerceptronModel models a classification or regression task as a multilayer perceptron neural net.
  • Hyperparameters
  • The following hyperparameters may be specified to control the perceptron net:
  • "Depth" 2 number of layers
    "Width" Scaled [10] neurons per layers
    "Activation" Tanh activation function
  • Deeper models can learn more complex, hierarchical patterns by building up abstractions layer by layer but require more data and training time. "Depth" can be increased when hierarchical structure in relationships between variables is suspected.
  • Wider models can capture more variation and nuances in the data at each level of abstraction but use more parameters and memory. "Width" can be increased when there are many samples and there is need to capture more complex patterns at each level.
  • Using "Width"Scaled [f] creates a net with Ceiling [f*Length [vars]] neurons per layer.
  • Variables
  • When not specified, variables will automatically be enumerated using x [i].
  • Valid variable specifications vars include:
  • n the number of variables
    symb a symbolic representation of a single variable
    {symb1,} a list of symbolic variables
  • Properties
  • Model properties can be extracted using Information [PowerModel[],prop].
  • Valid basic properties include:
  • "BaseType" model base type
    "Name" model name
    "ShortName" short identifier to use as label
    "InputType" supported input types
    "OutputType" supported output types
  • Valid data-related properties include:
  • "ColumnNames" names of the input features
    "ColumnVariableMap" map between column names and model variables
    "InputSize" dimensionality of the input
    "OutputSize" dimensionality of the output
    "Trainable" whether the model is fully specified and can be trained
    "Trained" whether the model can be evaluated numerically
    "VariableColumnMap" map between model variables and column names
    "Variables" name of the model variables
  • Hyperparameter-related properties include:
  • "HyperparameterDomain" specified hyperparameter search domain
    "Hyperparameters" hyperparameter values

Examples

open all close all

Basic Examples  (3)

Create a generic perceptron net model:

Wolfram Language code: PerceptronModel[]

Specify multiple custom hyperparameters:

Wolfram Language code: PerceptronModel[<|"Width" -> 10, "Depth" -> 3|>]

Train a net on the Old Faithful Eruptions dataset:

Wolfram Language code: model = ModelFit[ResourceData["Sample Data: Old Faithful Eruptions"], PerceptronModel[]]

Evaluate the model:

Wolfram Language code: model[<|"Duration" -> Quantity[4, "Minutes"]|>]

Extract the underlying net model:

Wolfram Language code: Information[model, "Parameters"]

Scope  (16)

Hyperparameters  (3)

"Depth"  (1)

Define a net with a default "Depth" value:

Wolfram Language code: PerceptronModel[]

Specify a custom value:

Wolfram Language code: PerceptronModel[<|"Depth" -> 3|>]

"Width"  (1)

Specify a wider net:

Wolfram Language code: PerceptronModel[<|"Width" -> 5|>]

"Activation"  (1)

Specify a different activation function:

Wolfram Language code: PerceptronModel[<|"Activation" -> Ramp|>]

Variables  (3)

Define a net with a specific number of variables:

Wolfram Language code: PerceptronModel[Automatic, 2]

Use explicit variable names:

Wolfram Language code: PerceptronModel[Automatic, {x, y, z}]

ModelFit will assume the number of variables is one less than the dimensionality of data points:

Wolfram Language code: ModelFit[{{1, 9, 55}, {1, 1, 7}, {1, 4, 25}, {8, 9, 118}, {8, 10, 124}, {8, 5, 94}}, PerceptronModel[]]

Evaluation  (3)

Evaluate a trained perceptron net model numerically:

Wolfram Language code: ModelFit[{...}, PerceptronModel[]][{1, 2}]

Evaluate the net on a list of inputs:

Wolfram Language code: ModelFit[{...}, PerceptronModel[]][{{1.17841, 7.0408}, {7.8774, 3.20304}, {5.12858, 7.89375}}]

Perceptron nets cannot be evaluated symbolically:

Wolfram Language code: ModelFit[{...}, PerceptronModel[]][{x, y}]

Information  (5)

View general information about a model:

Wolfram Language code: Information[PerceptronModel[]]

Some information is only available when variables or parameters are fully specified:

Wolfram Language code: Information[PerceptronModel[Association["Hyperparameters" -> Association["Depth" -> 2, "Width" -> 10, "Activation" -> Tanh]], Association["ParameterValues" -> Association["Net" -> NetChain[Association["Type" -> "Chain", "Nodes" -> Association[ ... , "Output" -> {3}], "SourceFunction" -> ModelFit, "CategoricalCastQ" -> False, "QuantityQ" -> False, "DateColumnsQ" -> False, "UncertaintyQ" -> False, "Domain" -> Association["f1" -> {1, 8}, "f2" -> {1, 10}, "f3" -> {7, 124}]]]]]]

Extract a single property:

Wolfram Language code: Information[PerceptronModel[Association["Hyperparameters" -> Association["Depth" -> 2, "Width" -> 10, "Activation" -> Tanh]], Association["ParameterValues" -> Association["Net" -> NetChain[Association["Type" -> "Chain", "Nodes" -> Association[ ... , "Output" -> {3}], "SourceFunction" -> ModelFit, "CategoricalCastQ" -> False, "QuantityQ" -> False, "DateColumnsQ" -> False, "UncertaintyQ" -> False, "Domain" -> Association["f1" -> {1, 8}, "f2" -> {1, 10}, "f3" -> {7, 124}]]]]], "Variables"]

Retrieve multiple properties:

Wolfram Language code: Information[PerceptronModel[Association["Hyperparameters" -> Association["Depth" -> 2, "Width" -> 10, "Activation" -> Tanh]], Association["ParameterValues" -> Association["Net" -> NetChain[Association["Type" -> "Chain", "Nodes" -> Association[ ... , "Output" -> {3}], "SourceFunction" -> ModelFit, "CategoricalCastQ" -> False, "QuantityQ" -> False, "DateColumnsQ" -> False, "UncertaintyQ" -> False, "Domain" -> Association["f1" -> {1, 8}, "f2" -> {1, 10}, "f3" -> {7, 124}]]]]], {"Variables", "Hyperparameters"}]

Get information about the default model values:

Wolfram Language code: Information[PerceptronModel[Automatic, 2], {"Variables", "Hyperparameters"}]

Fitting  (2)

Fit a perceptron net model with the default hyperparameters:

Wolfram Language code: ModelFit[{...}, PerceptronModel[]]

Fit multiple models at once:

Wolfram Language code: report = ModelFit[{...}, {PerceptronModel[<|"Width" -> 5|>], PerceptronModel[<|"Depth" -> 1|>]}, "Report"]

Compare the choice of hyperparameter values via cross-validation:

Wolfram Language code: report["CrossValidationChart"]
Wolfram Research (2026), PerceptronModel, Wolfram Language function, https://reference.wolfram.com/language/ref/PerceptronModel.html.

Text

Wolfram Research (2026), PerceptronModel, Wolfram Language function, https://reference.wolfram.com/language/ref/PerceptronModel.html.

CMS

Wolfram Language. 2026. "PerceptronModel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PerceptronModel.html.

APA

Wolfram Language. (2026). PerceptronModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PerceptronModel.html

BibTeX

@misc{reference.wolfram_2026_perceptronmodel, author="Wolfram Research", title="{PerceptronModel}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/PerceptronModel.html}", note=[Accessed: 15-August-2026]}

BibLaTeX

@online{reference.wolfram_2026_perceptronmodel, organization={Wolfram Research}, title={PerceptronModel}, year={2026}, url={https://reference.wolfram.com/language/ref/PerceptronModel.html}, note=[Accessed: 15-August-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /