KnnRegressor constructor
KnnRegressor(
- DataFrame fittingData,
- String targetName,
- int k, {
- KernelType kernel = KernelType.gaussian,
- Distance distance = Distance.euclidean,
- DType dtype = dTypeDefaultValue,
Parameters:
fittingData
Labelled observations, among which will be searched k
nearest to the given unlabelled observations neighbours. Must contain
targetName
column.
targetName
A string, that serves as a name of the column, that contains
labels (or outcomes).
k
a number of nearest neighbours to be found among fittingData
kernel
a type of a kernel function, that will be used to predict an
outcome for a new observation
distance
a distance type, that will be used to measure a distance
between two observation vectors
dtype
A data type for all the numeric values, used by the algorithm. Can
affect performance or accuracy of the computations. Default value is
dTypeDefaultValue
Implementation
factory KnnRegressor(
DataFrame fittingData,
String targetName,
int k, {
KernelType kernel = KernelType.gaussian,
Distance distance = Distance.euclidean,
DType dtype = dTypeDefaultValue,
}) =>
initKnnRegressorModule().get<KnnRegressorFactory>().create(
fittingData,
targetName,
k,
kernel,
distance,
dtype,
);