pub struct KernelParams<F, N = CommonNearestNeighbour> { /* private fields */ }
Expand description

Defines the set of parameters needed to build a kernel

Implementations

Setter for method, the inner product used by the kernel

Setter for kind, whether to construct a dense or sparse kernel

Setter for nn_algo, nearest neighbour algorithm for calculating adjacency matrices

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Builds a kernel from a view of the input data.

Parameters
  • x: view of a matrix of records (#records, #features)

A kernel build from x according to the parameters on which this method is called

Panics

If the kernel type is Sparse and the number of neighbors specified is not between 1 and #records-1

Builds a kernel from a view of the input data.

Parameters
  • x: view of a matrix of records (#records, #features)

A kernel build from x according to the parameters on which this method is called

Panics

If the kernel type is Sparse and the number of neighbors specified is not between 1 and #records-1

Builds a new Dataset with the kernel as the records and the same targets as the input one.

Parameters
  • x: A dataset with a matrix of records (#records, #features) and any targets
Returns

A new dataset with:

  • records: a kernel build from x.records() according to the parameters on which this method is called
  • targets: same as x.targets()
Panics

If the kernel type is Sparse and the number of neighbors specified is not between 1 and #records-1

Builds a new Dataset with the kernel as the records and the same targets as the input one.

Parameters
  • x: A dataset with a matrix of records (##records, ##features) and any targets
Returns

A new dataset with:

  • records: a kernel build from x.records() according to the parameters on which this method is called
  • targets: a slice of x.targets()
Panics

If the kernel type is Sparse and the number of neighbors specified is not between 1 and ##records-1

Builds a kernel from a view of the input data.

Parameters
  • x: view of a matrix of records (#records, #features)

A kernel build from x according to the parameters on which this method is called

Panics

If the kernel type is Sparse and the number of neighbors specified is not between 1 and #records-1

Builds a new Dataset with the kernel as the records and the same targets as the input one.

It takes ownership of the original dataset.

Parameters
  • x: A dataset with a matrix of records (#records, #features) and any targets
Returns

A new dataset with:

  • records: a kernel build from x.records() according to the parameters on which this method is called
  • targets: same as x.targets()
Panics

If the kernel type is Sparse and the number of neighbors specified is not between 1 and #records-1

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.