generator = new Agglomerate([ 'male' => new Blob([69.2, 195.7, 40.], [1., 3., 0.3]), 'female' => new Blob([63.7, 168.5, 38.1], [0.8, 2.5, 0.4]), ], [0.45, 0.55]); $this->estimator = new GaussianNB(); $this->validator = new MonteCarlo(3, 0.2); $this->metric = new Accuracy(); } /** * @test */ public function build() : void { $this->assertInstanceOf(MonteCarlo::class, $this->validator); $this->assertInstanceOf(Validator::class, $this->validator); $this->assertInstanceOf(Parallel::class, $this->validator); } /** * @test */ public function test() : void { [$min, $max] = $this->metric->range()->list(); $dataset = $this->generator->generate(self::DATASET_SIZE); $score = $this->validator->test($this->estimator, $dataset, $this->metric); $this->assertThat( $score, $this->logicalAnd( $this->greaterThanOrEqual($min), $this->lessThanOrEqual($max) ) ); } }