report = new AggregateReport([ 'matrix' => new ConfusionMatrix(), 'breakdown' => new MulticlassBreakdown(), ]); } /** * @test */ public function build() : void { $this->assertInstanceOf(AggregateReport::class, $this->report); $this->assertInstanceOf(ReportGenerator::class, $this->report); } /** * @test */ public function compatibility() : void { $expected = [ EstimatorType::classifier(), EstimatorType::anomalyDetector(), ]; $this->assertEquals($expected, $this->report->compatibility()); } /** * @test */ public function generate() : void { $predictions = ['wolf', 'lamb', 'wolf', 'lamb', 'wolf']; $labels = ['lamb', 'lamb', 'wolf', 'wolf', 'wolf']; $result = $this->report->generate($predictions, $labels); $this->assertInstanceOf(Report::class, $result); $this->assertCount(2, $result->toArray()); } }