fit($samples); $transformer->transform($samples); // expecting to remove first column self::assertEquals([[0, 1], [1, 0], [0, 0], [1, 1], [1, 0], [1, 1]], $samples); } public function testVarianceThresholdWithZeroThreshold(): void { $samples = [[0, 2, 0, 3], [0, 1, 4, 3], [0, 1, 1, 3]]; $transformer = new VarianceThreshold(); $transformer->fit($samples); $transformer->transform($samples); self::assertEquals([[2, 0], [1, 4], [1, 1]], $samples); } public function testThrowExceptionWhenThresholdBelowZero(): void { $this->expectException(InvalidArgumentException::class); new VarianceThreshold(-0.1); } }