removeoutliers.m.svn-base

来自「a function inside machine learning」· SVN-BASE 代码 · 共 14 行

SVN-BASE
14
字号
function [X, y] = removeOutliers(X, y)
% A function to remove the outlier examples in X 
% we simple remove anything that is greater than mean + 2*std 


norms = sqrt(sum(X.^2, 2)); 
meanNorm = mean(norms); 
stdNorm = std(norms); 

outlierIndices = find(norms > (meanNorm+stdNorm*2));

X(outlierIndices, :) = []; 
y(outlierIndices) = []; 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?