Top 3 Strategies for Optimal Gamma Selection

Cross-validation (e.g., k-fold), grid search, and Bayesian optimization are leading strategies to systematically explore and select an optimal 'gamma' hyperparameter, preventing OCSVM from creating overly complex and irregular decision boundaries.

The top 3

  1. Grid Search with Cross-Validation for Robust Gamma: Systematically explore a predefined range of gamma values, often in logarithmic steps, combined with cross-validation to find the optimal gamma that generalizes well to unseen data and prevents overfitting.
  2. Heuristics: Start with Data-Scaled Gamma Defaults: Utilize default 'auto' or 'scale' gamma settings, often `1/n_features` or `1/(n_features * X.var())`, as sensible starting points. These heuristics relate gamma to the inverse of the number of features or data variance, offering a data-aware initial value.
  3. Visualize Decision Boundaries to Prevent Overfitting: Visually inspect the decision boundaries formed by different gamma values, especially in lower-dimensional projections. A highly irregular or 'wiggly' boundary indicates high gamma overfitting to noise, while a too-smooth boundary suggests underfitting.

Sources

Open the full topic