Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
YuhanLiin committed Oct 16, 2023
1 parent 34d1c84 commit 39b3eee
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions algorithms/linfa-nn/src/balltree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<'a, F: Float> BallTreeInner<'a, F> {
}
}

/// Spatial indexing structure created by [`BallTree`](BallTree)
/// Spatial indexing structure created by [`BallTree`]
#[derive(Debug, Clone, PartialEq)]
pub struct BallTreeIndex<'a, F: Float, D: Distance<F>> {
tree: BallTreeInner<'a, F>,
Expand Down Expand Up @@ -282,7 +282,7 @@ impl<'a, F: Float, D: Distance<F>> NearestNeighbourIndex<F> for BallTreeIndex<'a
/// Implementation of ball tree, a space partitioning data structure that partitions its points
/// into nested hyperspheres called "balls". It performs spatial queries in `O(k * logN)` time,
/// where `k` is the number of points returned by the query. Calling `from_batch` returns a
/// [`BallTreeIndex`](BallTreeIndex).
/// [`BallTreeIndex`].
///
/// More details can be found [here](https://en.wikipedia.org/wiki/Ball_tree). This implementation
/// is based off of the [ball_tree](https://docs.rs/ball-tree/0.2.0/ball_tree/) crate.
Expand Down
4 changes: 2 additions & 2 deletions algorithms/linfa-nn/src/kdtree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
NnError, Point,
};

/// Spatial indexing structure created by [`KdTree`](KdTree)
/// Spatial indexing structure created by [`KdTree`]
#[derive(Debug)]
pub struct KdTreeIndex<'a, F: Float, D: Distance<F>>(
kdtree::KdTree<F, (Point<'a, F>, usize), &'a [F]>,
Expand Down Expand Up @@ -90,7 +90,7 @@ impl<'a, F: Float, D: Distance<F>> NearestNeighbourIndex<F> for KdTreeIndex<'a,
/// Implementation of K-D tree, a fast space-partitioning data structure. For each parent node,
/// the indexed points are split with a hyperplane into two child nodes. Due to its tree-like
/// structure, the K-D tree performs spatial queries in `O(k * logN)` time, where `k` is the number
/// of points returned by the query. Calling `from_batch` returns a [`KdTree`](KdTree).
/// of points returned by the query. Calling `from_batch` returns a [`KdTree`].
///
/// More details can be found [here](https://en.wikipedia.org/wiki/K-d_tree).
///
Expand Down
4 changes: 2 additions & 2 deletions algorithms/linfa-nn/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub enum NnError {

/// Nearest neighbour algorithm builds a spatial index structure out of a batch of points. The
/// distance between points is calculated using a provided distance function. The index implements
/// the [`NearestNeighbourIndex`](NearestNeighbourIndex) trait and allows for efficient
/// the [`NearestNeighbourIndex`] trait and allows for efficient
/// computing of nearest neighbour and range queries.
pub trait NearestNeighbour: std::fmt::Debug + Send + Sync + Unpin {
/// Builds a spatial index using a MxN two-dimensional array representing M points with N
Expand Down Expand Up @@ -115,7 +115,7 @@ pub trait NearestNeighbourIndex<F: Float>: Send + Sync + Unpin {
) -> Result<Vec<(Point<F>, usize)>, NnError>;
}

/// Enum that dispatches to one of the crate's [`NearestNeighbour`](NearestNeighbour)
/// Enum that dispatches to one of the crate's [`NearestNeighbour`]
/// implementations based on value. This enum should be used instead of using types like
/// `LinearSearch` and `KdTree` directly.
///
Expand Down
4 changes: 2 additions & 2 deletions algorithms/linfa-nn/src/linear.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
NearestNeighbourIndex, NnError, Point,
};

/// Spatial indexing structure created by [`LinearSearch`](LinearSearch)
/// Spatial indexing structure created by [`LinearSearch`]
#[derive(Debug, Clone, PartialEq)]
pub struct LinearSearchIndex<'a, F: Float, D: Distance<F>>(ArrayView2<'a, F>, D);

Expand Down Expand Up @@ -76,7 +76,7 @@ impl<'a, F: Float, D: Distance<F>> NearestNeighbourIndex<F> for LinearSearchInde

/// Implementation of linear search, which is the simplest nearest neighbour algorithm. All queries
/// are implemented by scanning through every point, so all of them are `O(N)`. Calling
/// `from_batch` returns a [`LinearSearchIndex`](LinearSearchIndex).
/// `from_batch` returns a [`LinearSearchIndex`].
#[derive(Default, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(
feature = "serde",
Expand Down
2 changes: 1 addition & 1 deletion algorithms/linfa-trees/src/decision_trees/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ impl<F: Float, L: Label> DecisionTree<F, L> {
self.iter_nodes().filter(|node| node.is_leaf()).count()
}

/// Generates a [`Tikz`](Tikz) structure to print the
/// Generates a [`Tikz`] structure to print the
/// fitted tree in Tex using tikz and forest, with the following default parameters:
///
/// * `legend=false`
Expand Down
4 changes: 2 additions & 2 deletions src/metrics_regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::ops::{Div, Sub};
/// Regression metrices trait for single targets.
///
/// It is possible to compute the listed mectrics between two 1D arrays.
/// To compare bi-dimensional arrays use [`MultiTargetRegression`](MultiTargetRegression).
/// To compare bi-dimensional arrays use [`MultiTargetRegression`].
pub trait SingleTargetRegression<F: Float, T: AsSingleTargets<Elem = F>>:
AsSingleTargets<Elem = F>
{
Expand Down Expand Up @@ -135,7 +135,7 @@ impl<F: Float, T: AsSingleTargets<Elem = F>, T2: AsSingleTargets<Elem = F>, D: D
/// Regression metrices trait for multiple targets.
///
/// It is possible to compute the listed mectrics between two 2D arrays.
/// To compare single-dimensional arrays use [`SingleTargetRegression`](SingleTargetRegression).
/// To compare single-dimensional arrays use [`SingleTargetRegression`].
pub trait MultiTargetRegression<F: Float, T: AsMultiTargets<Elem = F>>:
AsMultiTargets<Elem = F>
{
Expand Down

0 comments on commit 39b3eee

Please sign in to comment.