Radius Neighbors Regressor#
This is the regressor version of Radius Neighbors implementing a binary spatial tree under the hood for fast radius queries. The prediction is a weighted average of each label from the training set that is within a fixed user-defined radius.
Note: Samples with 0 neighbors within radius will be predicted NaN.
Data Type Compatibility: Depends on distance kernel
|1||radius||1.0||float||The radius within which points are considered neighbors.|
|2||weighted||true||bool||Should we consider the distances of our nearest neighbors when making predictions?|
|3||tree||BallTree||Spatial||The spatial tree used to run range searches.|
use Rubix\ML\Regressors\RadiusNeighborsRegressor; use Rubix\ML\Graph\Trees\BallTree; use Rubix\ML\Kernels\Distance\Diagonal; $estimator = new RadiusNeighborsRegressor(0.5, true, new BallTree(30, new Diagonal()));
Return the base spatial tree instance:
public tree() : Spatial