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: Unknown samples with no training samples within radius are labeled NaN. As such, Radius Neighbors can also be used as a quasi anomaly detector.
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.|
Return the base spatial tree instance:
public tree() : Spatial
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()));