Hi Nainsi,
MATLAB uses the "fitcsvm function". However, "fitcsvm"does not support one-class classification directly. You need to use the "fitcsvm" with 'OutlierFraction', which is equivalent to 1 - nu in R.
Kindly refer to the following code as example to implement "One class classification using fitcsvm".
% Assume PhaseI_Data is an n-by-d matrix (observations x features)
% and already normalized/scaled similarly to how it was used in R.
% Example dummy data: 100 points in 2D
PhaseI_Data = randn(100, 2); % Normally distributed data
% Convert R gamma to MATLAB's kernel scale:
% R: k(x, y) = exp(-gamma * ||x - y||^2)
% MATLAB: uses 'KernelScale', which is sigma such that
% k(x, y) = exp(-||x - y||^2 / (2*sigma^2))
gamma = 0.1; % or whatever value you used in R
sigma = sqrt(1 / (2 * gamma));
% MATLAB One-Class SVM equivalent:
SVMModel = fitcsvm(PhaseI_Data, ones(size(PhaseI_Data,1),1), ...
'KernelFunction', 'rbf', ...
'KernelScale', sigma, ...
'OutlierFraction', 1 - 0.1, ...
'Standardize', false);
For more information regarding "fitcsvm", kindly refer to the following MATLAB documentation: