1<?php 2 3namespace Rubix\ML\Transformers; 4 5use function Rubix\ML\warn_deprecated; 6 7/** 8 * Dense Random Projector 9 * 10 * The Dense Random Projector uses a random matrix sampled from a dense uniform 11 * distribution [-1, 1] to project a sample matrix onto a target dimensionality. 12 * 13 * References: 14 * [1] D. Achlioptas. (2003). Database-friendly random projections: Johnson-Lindenstrauss 15 * with binary coins. 16 * 17 * @deprecated 18 * 19 * @category Machine Learning 20 * @package Rubix/ML 21 * @author Andrew DalPino 22 */ 23class DenseRandomProjector extends SparseRandomProjector 24{ 25 /** 26 * @param int $dimensions 27 */ 28 public function __construct(int $dimensions) 29 { 30 warn_deprecated('Dense Random Projector is deprecated, use Sparse Random Projector with sparsity set to 0 instead.'); 31 32 parent::__construct($dimensions, 0.0); 33 } 34 35 /** 36 * Return the string representation of the object. 37 * 38 * @return string 39 */ 40 public function __toString() : string 41 { 42 return "Dense Random Projector (dimensions: {$this->dimensions})"; 43 } 44} 45