MultiLayerPerceptron / Regressor Layer

Multi-Layer Perceptron (MLP) Neural Network Regressor. This model optimizes the squared error using LBFGS or stochastic gradient descent.

Mathematical formulation: where:

  • hᵢ are hidden layer activations
  • Wᵢ are weight matrices
  • bᵢ are bias vectors
  • f is activation function

Key characteristics:

  • Deep learning model
  • Non-linear mapping
  • Gradient-based training
  • Universal approximation

Advantages:

  • Complex pattern learning
  • Automatic feature extraction
  • Scalable architecture
  • Non-linear regression

Common applications:

  • Function approximation
  • Pattern recognition
  • Time series prediction
  • Feature learning
  • Complex regression

Outputs:

  1. Predicted Table: Results with predictions
  2. Validation Results: Cross-validation metrics
  3. Test Metric: Hold-out performance
  4. Feature Importances: Network weights
Table
0
0
Predicted Table
1
Validation Results
2
Test Metric
3
Feature Importances

SelectFeatures

[column, ...]

Feature column selection for MLP Regression:

Requirements:

  1. Data properties:

    • Numeric values
    • No missing data
    • Finite numbers
    • Scaled features
  2. Neural network considerations:

    • Feature normalization
    • Dimensionality impact
    • Gradient flow
    • Activation ranges
  3. Preprocessing needs:

    • Standardization crucial
    • Outlier handling
    • Feature scaling
    • Dimension reduction
  4. Architecture impact:

    • Input layer size
    • Network capacity
    • Memory usage
    • Training speed

Best practices:

  • Scale to [-1, 1] or [0, 1]
  • Handle outliers
  • Consider PCA/dimensionality
  • Check feature importance

Note: If empty, uses all numeric columns except target

Target column specification for MLP Regression:

Requirements:

  1. Data type:

    • Numeric continuous
    • No missing values
    • Finite numbers
    • Real-valued
  2. Neural network aspects:

    • Output scaling
    • Activation range
    • Gradient magnitude
    • Loss computation
  3. Preprocessing needs:

    • Standardization/scaling
    • Outlier treatment
    • Distribution analysis
    • Transform consideration
  4. Training considerations:

    • Loss function range
    • Gradient scaling
    • Convergence impact
    • Performance metrics

Best practices:

  • Scale appropriately
  • Check distribution
  • Monitor gradients
  • Validate ranges

Note: Must be a single numeric column

Params

oneof
DefaultParams

Default configuration for MLP Regressor:

  1. Network architecture:

    • Single hidden layer (100 units)
    • ReLU activation
    • Full connectivity
  2. Optimization settings:

    • Adam optimizer
    • Learning rate: 0.001
    • L2 penalty: 0.0001
    • Batch size: 200
  3. Training control:

    • Max iterations: 200
    • Early stopping: Off
    • Momentum: 0.9
    • Adam parameters (β₁=0.9, β₂=0.999)

Best suited for:

  • Initial modeling
  • Medium-sized datasets
  • General regression
  • Standard problems

Customizable parameters for MLP Regressor:

Parameter categories:

  1. Architecture:

    • Network depth
    • Layer widths
    • Activation functions
  2. Optimization:

    • Solver choice
    • Learning rates
    • Regularization
  3. Training dynamics:

    • Batch processing
    • Momentum settings
    • Convergence control

Trade-offs:

  • Model capacity vs complexity
  • Training speed vs stability
  • Memory vs computation

Neural network architecture:

Layer configuration:

  • Number of hidden units
  • Single layer default: 100
  • Multiple layers possible

Guidelines:

  • Start with: √(n_in * n_out)
  • Pyramid structure: Decreasing
  • Consider data complexity

Impact:

  • Model capacity
  • Learning ability
  • Computational cost
  • Memory usage
Relu

Neural network activation functions:

Mathematical forms:

  1. Identity: f(x) = x
  2. Logistic: f(x) = 1/(1 + e⁻ˣ)
  3. Tanh: f(x) = tanh(x)
  4. ReLU: f(x) = max(0,x)

Properties:

  • Non-linearity
  • Differentiability
  • Range bounds
  • Gradient flow

Selection impact:

  • Training dynamics
  • Feature extraction
  • Convergence speed
  • Model capacity
Identity ~

Linear activation function:

Formula:

Properties:

  • Linear mapping
  • No saturation
  • Constant gradient
  • Direct flow

Best for:

  • Linear problems
  • Final layer
  • Feature passing
  • Debug purposes
Logistic ~

Sigmoid activation function:

Formula:

Properties:

  • Range [0,1]
  • Smooth gradient
  • Saturating
  • Probabilistic

Best for:

  • Bounded outputs
  • Probabilistic models
  • Smooth transitions
  • Historical networks
Tanh ~

Hyperbolic tangent function:

Formula:

Properties:

  • Range [-1,1]
  • Zero-centered
  • Stronger gradients
  • Saturating

Best for:

  • Hidden layers
  • Centered data
  • Deep networks
  • Complex patterns
Relu ~

Rectified Linear Unit:

Formula:

Properties:

  • Non-saturating
  • Sparse activation
  • Fast computation
  • Biological inspiration

Best for:

  • Deep networks
  • Fast training
  • Modern default
  • Feature extraction

Solver

enum
Adam

Neural network optimization algorithms:

Algorithm characteristics:

  1. LBFGS: Quasi-Newton method

    • Second-order optimization
    • Full batch updates
    • Memory intensive
  2. SGD: Stochastic Gradient Descent

    • First-order optimization
    • Minibatch updates
    • Momentum options
  3. Adam: Adaptive Moment Estimation

    • Adaptive learning rates
    • Momentum correction
    • Robust convergence

Selection criteria:

  • Dataset size
  • Memory constraints
  • Convergence needs
  • Training stability
Lbfgs ~

Limited-memory BFGS optimizer:

Characteristics:

  • Quasi-Newton method
  • Approximates Hessian
  • Full batch updates
  • Fast convergence

Best for:

  • Small datasets
  • Smooth problems
  • High precision
  • Limited iterations
Sgd ~

Stochastic Gradient Descent:

Updates:

Features:

  • Minibatch processing
  • Simple updates
  • Momentum options
  • Learning rate schedules

Best for:

  • Large datasets
  • Online learning
  • Linear scaling
  • Simple implementation
Adam ~

Adaptive Moment Estimation:

Update rule:

Advantages:

  • Adaptive learning rates
  • Momentum correction
  • Robust convergence
  • Parameter-specific updates

Best for:

  • Deep networks
  • Non-stationary problems
  • Large-scale learning
  • Modern default choice
0.0001

L2 regularization strength:

Penalty term:

Effects:

  • Weight decay
  • Overfitting control
  • Solution stability

Selection guide:

  • Small: 1e-5 to 1e-4
  • Medium: 1e-4 to 1e-3
  • Large: 1e-3 to 1e-2
200

Mini-batch size for gradient updates:

Impact on training:

  • Gradient estimation
  • Memory usage
  • Update frequency
  • Training speed

Selection guidelines:

  • Small (16-32):

    • Better generalization
    • Noisy updates
    • Less memory
  • Large (128-256):

    • Stable gradients
    • Faster training
    • GPU efficiency

Note: Ignored for LBFGS solver

Constant

Learning rate scheduling strategies:

Schedule types:

  1. Constant: Fixed rate
  2. Inverse scaling: Time decay
  3. Adaptive: Performance-based

Impact on training:

  • Convergence speed
  • Solution quality
  • Training stability
  • Optimization dynamics
Constant ~

Fixed learning rate:

Formula:

Properties:

  • Simple implementation
  • Predictable behavior
  • Requires careful tuning
  • No adaptation

Best for:

  • Well-behaved problems
  • Short training runs
  • Known optimal rate
  • Stable gradients
Invscaling ~

Inverse time decay:

Formula:

Properties:

  • Gradual decay
  • Power-law scaling
  • Theoretical guarantees
  • Smooth reduction

Best for:

  • Long training runs
  • Convex problems
  • Theoretical analysis
  • Stable convergence
Adaptive ~

Performance-based adaptation:

Strategy:

  • Monitor loss changes
  • Reduce rate on plateau
  • Early stopping option
  • Dynamic adjustment

Properties:

  • Automatic tuning
  • Loss-sensitive
  • Robust training
  • Plateau handling

Best for:

  • Unknown problems
  • Complex landscapes
  • Auto-tuning needs
  • Practical applications

Initial learning rate:

Importance:

  • Controls step size
  • Training stability
  • Convergence speed

Typical ranges:

  • Conservative: 1e-4
  • Standard: 1e-3
  • Aggressive: 1e-2

Note: Critical for SGD/Adam

0.5

Inverse scaling exponent:

Schedule formula:

Common values:

  • 0.5: Standard decay
  • 0.25: Slower decay
  • 1.0: Faster decay

Note: Used with invscaling

200

Maximum training iterations:

Training control:

  • Complete dataset passes
  • Convergence limit
  • Resource control

Guidelines:

  • Simple: 100-200
  • Complex: 500-1000
  • Deep: 1000+

Consider with early stopping

true

Whether to shuffle samples in each iteration.

Benefits:

  • Prevents cycles
  • Better generalization
  • Reduces bias
  • Improves convergence

When False:

  • Deterministic order
  • Debugging easier
  • Time series cases

Note: For SGD and Adam only

Random number generation seed:

Controls:

  • Weight initialization
  • Data shuffling
  • Batch sampling
  • Reproducibility

Usage:

  • Fixed: Reproducible runs
  • Different: Robustness check
  • 0: System random

Tol

f64
0.0001

Optimization tolerance:

Convergence criterion:

Values:

  • Strict: 1e-5
  • Standard: 1e-4
  • Relaxed: 1e-3

Impact:

  • Solution precision
  • Training duration
  • Stopping condition
true

When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble, otherwise, just fit a whole new ensemble.

When True:

  • Reuses weights
  • Continues training
  • Transfer learning
  • Incremental learning

Best for:

  • Fine-tuning
  • Progressive training
  • Online learning
0.9

Gradient descent momentum:

Update rule:

Effects:

  • Accelerates training
  • Reduces oscillations
  • Better local minima
  • Smoother convergence

Typical values:

  • None: 0.0
  • Standard: 0.9
  • High: 0.99

Note: SGD solver only

Nesterov momentum control:

Update rule:

Advantages:

  • Faster convergence
  • Better theoretical properties
  • Look-ahead gradient
  • Enhanced momentum

Use when:

  • momentum > 0
  • SGD solver
  • Speed critical
false

Early stopping control:

Mechanism:

  • Monitors validation score
  • Stops on plateau
  • Prevents overfitting
  • Saves computation

Requirements:

  • Validation fraction
  • Patience setting
  • Tolerance level
  • Score monitoring

Best practices:

  • Use with sufficient data
  • Monitor validation curve
  • Balance patience/tolerance

Early stopping validation size:

Data split:

  • Training: 1 - fraction
  • Validation: fraction

Guidelines:

  • Small data: 0.2
  • Medium data: 0.1
  • Large data: 0.05

Trade-offs:

  • Validation quality
  • Training data size
  • Stopping reliability
0.9

Adam first moment decay:

Role in Adam:

Properties:

  • Momentum control
  • Gradient smoothing
  • Historical influence

Typical values:

  • Standard: 0.9
  • Range: [0.85, 0.95]
  • Paper default: 0.9
0.999

Adam second moment decay:

Role in Adam:

Properties:

  • Variance control
  • Adaptive learning
  • Scale adjustment

Typical values:

  • Standard: 0.999
  • Range: [0.99, 0.9999]
  • Paper default: 0.999
0.00000001

Adam numerical stability:

Used in update:

Purpose:

  • Prevents division by zero
  • Numerical stability
  • Update conditioning

Typical values:

  • Default: 1e-8
  • Range: [1e-10, 1e-7]
  • Stability vs precision

Early stopping patience:

Stopping logic:

  • Monitor n consecutive epochs
  • Check improvement > tol
  • Stop if no progress

Settings:

  • Short: 5-10 epochs
  • Medium: 10-20 epochs
  • Long: 20+ epochs

Trade-offs:

  • Training time
  • Convergence certainty
  • Resource usage
15000

LBFGS function evaluation limit:

Controls:

  • Optimization depth
  • Computation budget
  • Solution precision

Guidelines:

  • Standard: 15000
  • Simple: 5000-10000
  • Complex: 20000+

Note: LBFGS solver only

Hyperparameter optimization for MLP Regressor:

Search space organization:

  1. Architecture:

    • Network topology
    • Hidden layers
    • Activation functions
  2. Optimization:

    • Solver selection
    • Learning rates
    • Momentum settings
  3. Regularization:

    • L2 penalty
    • Early stopping
    • Batch sizes

Best practices:

  • Start coarse, refine later
  • Consider computational cost
  • Monitor convergence
  • Balance exploration
100

Network architecture search:

Search patterns:

  1. Single layer:

    • [50, 100, 200]
    • Width exploration
  2. Multiple layers:

    • [32-16, 64-32, 128-64]
    • Depth vs width
  3. Systematic:

    • Based on input size
    • Geometric progression
    • Capacity scaling

Activation

[enum, ...]
Relu

Neural network activation functions:

Mathematical forms:

  1. Identity: f(x) = x
  2. Logistic: f(x) = 1/(1 + e⁻ˣ)
  3. Tanh: f(x) = tanh(x)
  4. ReLU: f(x) = max(0,x)

Properties:

  • Non-linearity
  • Differentiability
  • Range bounds
  • Gradient flow

Selection impact:

  • Training dynamics
  • Feature extraction
  • Convergence speed
  • Model capacity
Identity ~

Linear activation function:

Formula:

Properties:

  • Linear mapping
  • No saturation
  • Constant gradient
  • Direct flow

Best for:

  • Linear problems
  • Final layer
  • Feature passing
  • Debug purposes
Logistic ~

Sigmoid activation function:

Formula:

Properties:

  • Range [0,1]
  • Smooth gradient
  • Saturating
  • Probabilistic

Best for:

  • Bounded outputs
  • Probabilistic models
  • Smooth transitions
  • Historical networks
Tanh ~

Hyperbolic tangent function:

Formula:

Properties:

  • Range [-1,1]
  • Zero-centered
  • Stronger gradients
  • Saturating

Best for:

  • Hidden layers
  • Centered data
  • Deep networks
  • Complex patterns
Relu ~

Rectified Linear Unit:

Formula:

Properties:

  • Non-saturating
  • Sparse activation
  • Fast computation
  • Biological inspiration

Best for:

  • Deep networks
  • Fast training
  • Modern default
  • Feature extraction

Solver

[enum, ...]
Adam

Neural network optimization algorithms:

Algorithm characteristics:

  1. LBFGS: Quasi-Newton method

    • Second-order optimization
    • Full batch updates
    • Memory intensive
  2. SGD: Stochastic Gradient Descent

    • First-order optimization
    • Minibatch updates
    • Momentum options
  3. Adam: Adaptive Moment Estimation

    • Adaptive learning rates
    • Momentum correction
    • Robust convergence

Selection criteria:

  • Dataset size
  • Memory constraints
  • Convergence needs
  • Training stability
Lbfgs ~

Limited-memory BFGS optimizer:

Characteristics:

  • Quasi-Newton method
  • Approximates Hessian
  • Full batch updates
  • Fast convergence

Best for:

  • Small datasets
  • Smooth problems
  • High precision
  • Limited iterations
Sgd ~

Stochastic Gradient Descent:

Updates:

Features:

  • Minibatch processing
  • Simple updates
  • Momentum options
  • Learning rate schedules

Best for:

  • Large datasets
  • Online learning
  • Linear scaling
  • Simple implementation
Adam ~

Adaptive Moment Estimation:

Update rule:

Advantages:

  • Adaptive learning rates
  • Momentum correction
  • Robust convergence
  • Parameter-specific updates

Best for:

  • Deep networks
  • Non-stationary problems
  • Large-scale learning
  • Modern default choice

Alpha

[f64, ...]
0.0001

L2 regularization search:

Search spaces:

  1. Standard range:

    • [1e-5, 1e-4, 1e-3]
    • Common values
  2. Wide range:

    • [1e-6, 1e-4, 1e-2]
    • Regularization study
  3. Fine-tuning:

    • Around best alpha
    • Narrow search

BatchSize

[u64, ...]
200

Mini-batch size search:

Search patterns:

  1. Power of 2:

    • [32, 64, 128, 256]
    • GPU efficient
  2. Memory-based:

    • Based on resources
    • System constraints
  3. Learning-focused:

    • Small to large
    • Noise vs stability

LearningRate

[enum, ...]
Constant

Learning rate scheduling strategies:

Schedule types:

  1. Constant: Fixed rate
  2. Inverse scaling: Time decay
  3. Adaptive: Performance-based

Impact on training:

  • Convergence speed
  • Solution quality
  • Training stability
  • Optimization dynamics
Constant ~

Fixed learning rate:

Formula:

Properties:

  • Simple implementation
  • Predictable behavior
  • Requires careful tuning
  • No adaptation

Best for:

  • Well-behaved problems
  • Short training runs
  • Known optimal rate
  • Stable gradients
Invscaling ~

Inverse time decay:

Formula:

Properties:

  • Gradual decay
  • Power-law scaling
  • Theoretical guarantees
  • Smooth reduction

Best for:

  • Long training runs
  • Convex problems
  • Theoretical analysis
  • Stable convergence
Adaptive ~

Performance-based adaptation:

Strategy:

  • Monitor loss changes
  • Reduce rate on plateau
  • Early stopping option
  • Dynamic adjustment

Properties:

  • Automatic tuning
  • Loss-sensitive
  • Robust training
  • Plateau handling

Best for:

  • Unknown problems
  • Complex landscapes
  • Auto-tuning needs
  • Practical applications
0.001

Initial learning rate search:

Search spaces:

  1. Standard range:

    • [0.0001, 0.001, 0.01]
    • Log-scale search
    • Common values
  2. Fine-grained:

    • [0.0003, 0.001, 0.003]
    • Around promising value
    • Precise tuning
  3. Solver-specific:

    • Adam: [0.0001, 0.001]
    • SGD: [0.01, 0.1]
    • Algorithm-matched

PowerT

[f64, ...]
0.5

Learning rate decay search:

Search ranges:

  1. Standard decay:

    • [0.3, 0.5, 0.7]
    • Around classical 0.5
  2. Wide range:

    • [0.1, 0.5, 1.0]
    • Decay impact study
  3. Fine control:

    • [0.4, 0.5, 0.6]
    • Precise adjustment

Note: For invscaling only

MaxIter

[u64, ...]
200

Maximum iterations search:

Search patterns:

  1. Standard range:

    • [100, 200, 500]
    • Basic problems
  2. Deep learning:

    • [500, 1000, 2000]
    • Complex networks
  3. Convergence study:

    • Log-scale spacing
    • Resource impact
    • Training dynamics

Shuffle

[bool, ...]
true

Training order evaluation:

Options:

  1. Standard: [true]

    • Random order
    • Better generalization
  2. Sequential: [false]

    • Fixed order
    • Time series data
  3. Compare: [true, false]

    • Order sensitivity
    • Learning stability

Random seed configuration:

Usage patterns:

  1. Development:

    • Fixed seed
    • Reproducible results
    • Debug capability
  2. Production:

    • Multiple seeds
    • Robustness check
    • Model stability

Best practices:

  • Document seeds
  • Verify consistency
  • Multiple trials

Tol

[f64, ...]
0.0001

Convergence tolerance search:

Search spaces:

  1. Standard range:

    • [1e-4, 1e-3, 1e-2]
    • Common values
  2. High precision:

    • [1e-5, 1e-4, 1e-3]
    • Exact solutions
  3. Quick convergence:

    • [1e-3, 1e-2]
    • Faster training

WarmStart

[bool, ...]
true

When set to True, reuse the solution of the previous call to fit and add more estimators to the ensemble, otherwise, just fit a whole new ensemble.

Options:

  1. Fresh start: [false]

    • New weights
    • Independent trials
  2. Continue: [true]

    • Weight reuse
    • Transfer learning
  3. Compare: [true, false]

    • Initialization impact
    • Learning transfer

Momentum

[f64, ...]
0.9

Momentum parameter search:

Search ranges:

  1. Classical:

    • [0.0, 0.9, 0.99]
    • Standard values
    • Acceleration study
  2. Fine-tuning:

    • [0.85, 0.9, 0.95]
    • Around 0.9
    • Precise control
  3. Comprehensive:

    • [0.5, 0.7, 0.9, 0.99]
    • Full range impact
    • Training dynamics

Note: SGD solver only

true

Nesterov momentum evaluation:

Options:

  1. Standard: [true]

    • Advanced momentum
    • Better convergence
  2. Classical: [false]

    • Regular momentum
    • Simpler updates
  3. Compare: [true, false]

    • Acceleration impact
    • Convergence speed

Use with: momentum > 0

false

Early stopping evaluation:

Configuration impact:

  1. Without (false):

    • Full training
    • Maximum iterations
    • Complete convergence
  2. With (true):

    • Validation-based
    • Automatic stopping
    • Overfitting prevention

Consider with:

  • validation_fraction
  • n_iter_no_change
  • tol settings

Validation split size:

Selection guide:

  1. Small datasets:

    • 0.2 validation
    • Stable evaluation
  2. Large datasets:

    • 0.1 or less
    • More training data
  3. Considerations:

    • Data availability
    • Validation stability
    • Training needs

Beta1

[f64, ...]
0.9

Adam first moment search:

Search spaces:

  1. Standard range:

    • [0.85, 0.9, 0.95]
    • Around default 0.9
  2. Wide range:

    • [0.8, 0.9, 0.99]
    • Momentum impact
  3. Fine-tuning:

    • [0.88, 0.9, 0.92]
    • Precise control

Note: Adam solver only

Beta2

[f64, ...]
0.999

Adam second moment search:

Search spaces:

  1. Conservative:

    • [0.995, 0.999, 0.9999]
    • High stability
  2. Exploratory:

    • [0.99, 0.999, 0.9999]
    • Variance control
  3. Fine-tuning:

    • [0.998, 0.999, 0.9995]
    • Around optimal

Note: Adam solver only

Epsilon

[f64, ...]
0.00000001

Adam numerical stability search:

Search ranges:

  1. Standard:

    • [1e-8, 1e-7, 1e-6]
    • Common values
  2. Stability focus:

    • [1e-9, 1e-8, 1e-7]
    • Numerical robustness
  3. Precision study:

    • Multiple scales
    • Stability impact

Note: Adam solver only

Early stopping patience:

Configuration guide:

  1. Quick stopping:

    • 5-10 epochs
    • Fast adaptation
  2. Patient training:

    • 10-20 epochs
    • Better convergence
  3. Deep learning:

    • 20+ epochs
    • Complex patterns

MaxFun

[u32, ...]
15000

LBFGS function evaluation search:

Search patterns:

  1. Quick solutions:

    • [5000, 10000]
    • Fast convergence
  2. Standard range:

    • [10000, 15000, 20000]
    • Balanced approach
  3. Thorough search:

    • [15000, 25000, 35000]
    • High precision

Note: LBFGS solver only

R2score

Regression model evaluation metrics:

Purpose:

  • Model performance evaluation
  • Error measurement
  • Quality assessment
  • Model comparison

Selection criteria:

  • Error distribution
  • Scale sensitivity
  • Domain requirements
  • Business objectives
Default ~

Model's native scoring method:

  • Typically R² score
  • Model-specific implementation
  • Standard evaluation
  • Quick assessment
R2score ~

Coefficient of determination (R²):

Formula:

Properties:

  • Range: (-∞, 1]
  • 1: Perfect prediction
  • 0: Constant model
  • Negative: Worse than mean

Best for:

  • General performance
  • Variance explanation
  • Model comparison
  • Standard reporting
ExplainedVariance ~

Explained variance score:

Formula:

Properties:

  • Range: (-∞, 1]
  • Accounts for bias
  • Variance focus
  • Similar to R²

Best for:

  • Variance analysis
  • Bias assessment
  • Model stability
MaxError ~

Maximum absolute error:

Formula:

Properties:

  • Worst case error
  • Original scale
  • Sensitive to outliers
  • Upper error bound

Best for:

  • Critical applications
  • Error bounds
  • Safety margins
  • Risk assessment
NegMeanAbsoluteError ~

Negative mean absolute error:

Formula:

Properties:

  • Linear error scale
  • Robust to outliers
  • Original units
  • Negated for optimization

Best for:

  • Robust evaluation
  • Interpretable errors
  • Outlier presence
NegMeanSquaredError ~

Negative mean squared error:

Formula:

Properties:

  • Squared error scale
  • Outlier sensitive
  • Squared units
  • Negated for optimization

Best for:

  • Standard optimization
  • Large error penalty
  • Statistical analysis
NegRootMeanSquaredError ~

Negative root mean squared error:

Formula:

Properties:

  • Original scale
  • Outlier sensitive
  • Interpretable units
  • Negated for optimization

Best for:

  • Standard reporting
  • Interpretable errors
  • Model comparison
NegMeanSquaredLogError ~

Negative mean squared logarithmic error:

Formula:

Properties:

  • Relative error scale
  • For positive values
  • Sensitive to ratios
  • Negated for optimization

Best for:

  • Exponential growth
  • Relative differences
  • Positive predictions
NegMedianAbsoluteError ~

Negative median absolute error:

Formula:

Properties:

  • Highly robust
  • Original scale
  • Outlier resistant
  • Negated for optimization

Best for:

  • Robust evaluation
  • Heavy-tailed errors
  • Outlier presence
NegMeanPoissonDeviance ~

Negative Poisson deviance:

Formula:

Properties:

  • For count data
  • Non-negative values
  • Poisson assumption
  • Negated for optimization

Best for:

  • Count prediction
  • Event frequency
  • Rate modeling
NegMeanGammaDeviance ~

Negative Gamma deviance:

Formula:

Properties:

  • For positive continuous data
  • Constant CV assumption
  • Relative errors
  • Negated for optimization

Best for:

  • Positive continuous data
  • Multiplicative errors
  • Financial modeling
NegMeanAbsolutePercentageError ~

Negative mean absolute percentage error:

Formula:

Properties:

  • Percentage scale
  • Scale independent
  • For non-zero targets
  • Negated for optimization

Best for:

  • Relative performance
  • Scale-free comparison
  • Business metrics
D2AbsoluteErrorScore ~

D² score with absolute error:

Formula:

Properties:

  • Range: (-∞, 1]
  • Robust version of R²
  • Linear error scale
  • Outlier resistant

Best for:

  • Robust evaluation
  • Non-normal errors
  • Alternative to R²
D2PinballScore ~

D² score with pinball loss:

Properties:

  • Quantile focus
  • Asymmetric errors
  • Risk assessment
  • Distribution modeling

Best for:

  • Quantile regression
  • Risk analysis
  • Asymmetric costs
  • Distribution tails
D2TweedieScore ~

D² score with Tweedie deviance:

Properties:

  • Compound Poisson-Gamma
  • Flexible dispersion
  • Mixed distributions
  • Insurance modeling

Best for:

  • Insurance claims
  • Mixed continuous-discrete
  • Compound distributions
  • Specialized modeling

Split

oneof
DefaultSplit

Standard train-test split configuration optimized for general classification tasks.

Configuration:

  • Test size: 20% (0.2)
  • Random seed: 98
  • Shuffling: Enabled
  • Stratification: Based on target distribution

Advantages:

  • Preserves class distribution
  • Provides reliable validation
  • Suitable for most datasets

Best for:

  • Medium to large datasets
  • Independent observations
  • Initial model evaluation

Splitting uses the ShuffleSplit strategy or StratifiedShuffleSplit strategy depending on the field stratified. Note: If shuffle is false then stratified must be false.

Configurable train-test split parameters for specialized requirements. Allows fine-tuning of data division strategy for specific use cases or constraints.

Use cases:

  • Time series data
  • Grouped observations
  • Specific train/test ratios
  • Custom validation schemes

Random seed for reproducible splits. Ensures:

  • Consistent train/test sets
  • Reproducible experiments
  • Comparable model evaluations

Same seed guarantees identical splits across runs.

true

Data shuffling before splitting. Effects:

  • true: Randomizes order, better for i.i.d. data
  • false: Maintains order, important for time series

When to disable:

  • Time dependent data
  • Sequential patterns
  • Grouped observations
0.8

Proportion of data for training. Considerations:

  • Larger (e.g., 0.8-0.9): Better model learning
  • Smaller (e.g., 0.5-0.7): Better validation

Common splits:

  • 0.8: Standard (80/20 split)
  • 0.7: More validation emphasis
  • 0.9: More training emphasis
false

Maintain class distribution in splits. Important when:

  • Classes are imbalanced
  • Small classes present
  • Representative splits needed

Requirements:

  • Classification tasks only
  • Cannot use with shuffle=false
  • Sufficient samples per class

Cv

oneof
DefaultCv

Standard cross-validation configuration using stratified 3-fold splitting.

Configuration:

  • Folds: 3
  • Method: StratifiedKFold
  • Stratification: Preserves class proportions

Advantages:

  • Balanced evaluation
  • Reasonable computation time
  • Good for medium-sized datasets

Limitations:

  • May be insufficient for small datasets
  • Higher variance than larger fold counts
  • May miss some data patterns

Configurable stratified k-fold cross-validation for specific validation requirements.

Features:

  • Adjustable fold count with NFolds determining the number of splits.
  • Stratified sampling
  • Preserved class distributions

Use cases:

  • Small datasets (more folds)
  • Large datasets (fewer folds)
  • Detailed model evaluation
  • Robust performance estimation
3

Number of cross-validation folds. Guidelines:

  • 3-5: Large datasets, faster training
  • 5-10: Standard choice, good balance
  • 10+: Small datasets, thorough evaluation

Trade-offs:

  • More folds: Better evaluation, slower training
  • Fewer folds: Faster training, higher variance

Must be at least 2.

K-fold cross-validation without stratification. Divides data into k consecutive folds for iterative validation.

Process:

  • Splits data into k equal parts
  • Each fold serves as validation once
  • Remaining k-1 folds form training set

Use cases:

  • Regression problems
  • Large, balanced datasets
  • When stratification unnecessary
  • Continuous target variables

Limitations:

  • May not preserve class distributions
  • Less suitable for imbalanced data
  • Can create biased splits with ordered data

Number of folds for cross-validation. Selection guide: Recommended values:

  • 5: Standard choice (default)
  • 3: Large datasets/quick evaluation
  • 10: Thorough evaluation/smaller datasets

Trade-offs:

  • Higher values: More thorough, computationally expensive
  • Lower values: Faster, potentially higher variance

Must be at least 2 for valid cross-validation.

Random seed for fold generation when shuffling. Important for:

  • Reproducible results
  • Consistent fold assignments
  • Benchmark comparisons
  • Debugging and validation

Set specific value for reproducibility across runs.

true

Whether to shuffle data before splitting into folds. Effects:

  • true: Randomized fold composition (recommended)
  • false: Sequential splitting

Enable when:

  • Data may have ordering
  • Better fold independence needed

Disable for:

  • Time series data
  • Ordered observations

Stratified K-fold cross-validation maintaining class proportions across folds.

Key features:

  • Preserves class distribution in each fold
  • Handles imbalanced datasets
  • Ensures representative splits

Best for:

  • Classification problems
  • Imbalanced class distributions
  • When class proportions matter

Requirements:

  • Classification tasks only
  • Sufficient samples per class
  • Categorical target variable

Number of stratified folds. Guidelines: Typical values:

  • 5: Standard for most cases
  • 3: Quick evaluation/large datasets
  • 10: Detailed evaluation/smaller datasets

Considerations:

  • Must allow sufficient samples per class per fold
  • Balance between stability and computation time
  • Consider smallest class size when choosing

Seed for reproducible stratified splits. Ensures:

  • Consistent fold assignments
  • Reproducible results
  • Comparable experiments
  • Systematic validation

Fixed seed guarantees identical stratified splits.

false

Data shuffling before stratified splitting. Impact:

  • true: Randomizes while maintaining stratification
  • false: Maintains data order within strata

Use cases:

  • true: Independent observations
  • false: Grouped or sequential data

Class proportions maintained regardless of setting.

Random permutation cross-validator with independent sampling.

Characteristics:

  • Random sampling for each split
  • Independent train/test sets
  • More flexible than K-fold
  • Can have overlapping test sets

Advantages:

  • Control over test size
  • Fresh splits each iteration
  • Good for large datasets

Limitations:

  • Some samples might never be tested
  • Others might be tested multiple times
  • No guarantee of complete coverage

Number of random splits to perform. Consider: Common values:

  • 5: Standard evaluation
  • 10: More thorough assessment
  • 3: Quick estimates

Trade-offs:

  • More splits: Better estimation, longer runtime
  • Fewer splits: Faster, less stable estimates

Balance between computation and stability.

Random seed for reproducible shuffling. Controls:

  • Split randomization
  • Sample selection
  • Result reproducibility

Important for:

  • Debugging
  • Comparative studies
  • Result verification
0.2

Proportion of samples for test set. Guidelines: Common ratios:

  • 0.2: Standard (80/20 split)
  • 0.25: More validation emphasis
  • 0.1: More training data

Considerations:

  • Dataset size
  • Model complexity
  • Validation requirements

It must be between 0.0 and 1.0.

Stratified random permutation cross-validator combining shuffle-split with stratification.

Features:

  • Maintains class proportions
  • Random sampling within strata
  • Independent splits
  • Flexible test size

Ideal for:

  • Imbalanced datasets
  • Large-scale problems
  • When class distributions matter
  • Flexible validation schemes

Number of stratified random splits. Guidelines: Recommended values:

  • 5: Standard evaluation
  • 10: Detailed analysis
  • 3: Quick assessment

Consider:

  • Sample size per class
  • Computational resources
  • Stability requirements

Seed for reproducible stratified sampling. Ensures:

  • Consistent class proportions
  • Reproducible splits
  • Comparable experiments

Critical for:

  • Benchmarking
  • Research studies
  • Quality assurance
0.2

Fraction of samples for stratified test set. Best practices: Common splits:

  • 0.2: Balanced evaluation
  • 0.3: More thorough testing
  • 0.15: Preserve training size

Consider:

  • Minority class size
  • Overall dataset size
  • Validation objectives

It must be between 0.0 and 1.0.

Time Series cross-validator. Provides train/test indices to split time series data samples that are observed at fixed time intervals, in train/test sets. It is a variation of k-fold which returns first k folds as train set and the k + 1th fold as test set. Note that unlike standard cross-validation methods, successive training sets are supersets of those that come before them. Also, it adds all surplus data to the first training partition, which is always used to train the model. Key features:

  • Maintains temporal dependence
  • Expanding window approach
  • Forward-chaining splits
  • No future data leakage

Use cases:

  • Sequential data
  • Financial forecasting
  • Temporal predictions
  • Time-dependent patterns

Note: Training sets are supersets of previous iterations.

Number of temporal splits. Considerations: Typical values:

  • 5: Standard forward chaining
  • 3: Limited historical data
  • 10: Long time series

Impact:

  • Affects training window growth
  • Determines validation points
  • Influences computational load

Maximum size of training set. Should be strictly less than the number of samples. Applications:

  • 0: Use all available past data
  • >0: Rolling window of fixed size

Use cases:

  • Limit historical relevance
  • Control computational cost
  • Handle concept drift
  • Memory constraints

Number of samples in each test set. When 0:

  • Auto-calculated as n_samples/(n_splits+1)
  • Ensures equal-sized test sets

Considerations:

  • Forecast horizon
  • Validation requirements
  • Available future data

Gap

u64
0

Number of samples to exclude from the end of each train set before the test set.Gap between train and test sets. Uses:

  • Avoid data leakage
  • Model forecast lag
  • Buffer periods

Common scenarios:

  • 0: Continuous prediction
  • >0: Forward gap for realistic evaluation
  • Match business forecasting needs