Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
IntroductionRenderer GalleryRenderersAnalysis
computeQuantilescomputePercentilescomputeCorrelationcomputeCovariancedetectOutliersdetectOutliersZScorecomputeExtendedStatsdescribeExtendedStatsQuantileResultCorrelationResultOutlierResultExtendedStatscreateDBSCANdbscanDBSCANDBSCAN.fitDBSCAN.destroyDBSCANOptionsDBSCANResultcreateHierarchicalClusteringhierarchicalClusteringHierarchicalClusteringHierarchicalClustering.fitHierarchicalClustering.destroyLinkageMethodDistanceMetricHierarchicalOptionsDendrogramNodeHierarchicalResultcomputeHistogramgetHistogramCentersnormalizeHistogramHistogramResultcreateKDEkdeKDEKDE.fitKDE.destroyKernelTypeKDEOptionsKDEResultcreateKMeanskmeansKMeansKMeans.fitKMeans.destroyKMeansOptionsKMeansResultcreatePCApcaPCAPCA.fitPCA.destroyPCAOptionsPCAResultthrottleProgressconsoleProgressProgressInfoProgressCallbackcomputeStatscomputeMinMaxdescribeStatsTensorStatscreateTSNEtsneTSNETSNE.fitTSNE.destroyTSNEOptionsTSNEResultcreateUMAPumapUMAPUMAP.fitUMAP.destroyUMAPOptionsUMAPResult
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. viz
  3. viz
  4. analysis
  5. detectOutliers

viz.analysis.detectOutliers

function detectOutliers(tensor: Tensor, k = 1.5): Promise<OutlierResult>

Detect outliers using the Interquartile Range (IQR) method.

Outliers are values below Q1 - kIQR or above Q3 + kIQR, where k is typically 1.5 (default) for outliers or 3.0 for extreme outliers.

Parameters

tensorTensor
Input tensor
kunknownoptional
IQR multiplier (default 1.5)

Returns

Promise<OutlierResult>– Outlier detection results

Examples

const result = await detectOutliers(data);
console.log(`Found ${result.count} outliers`);
console.log(`Fences: [${result.lowerFence}, ${result.upperFence}]`);
Previous
describeStats
Next
detectOutliersZScore