Skip to content

Commit 13a3bf1

Browse files
committed
more doc updates
1 parent de1ae76 commit 13a3bf1

File tree

9 files changed

+18
-13
lines changed

9 files changed

+18
-13
lines changed

src/linalg/traits/svd.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ pub struct SVD<T: Number + RealNumber, M: SVDDecomposable<T>> {
4848
pub V: M,
4949
/// Singular values of the original matrix
5050
pub s: Vec<T>,
51-
///
5251
m: usize,
53-
///
5452
n: usize,
5553
/// Tolerance
5654
tol: T,

src/naive_bayes/bernoulli.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<TY: Number + Ord + Unsigned> BernoulliNBDistribution<TY> {
258258
/// * `x` - training data.
259259
/// * `y` - vector with target values (classes) of length N.
260260
/// * `priors` - Optional vector with prior probabilities of the classes. If not defined,
261-
/// priors are adjusted according to the data.
261+
/// priors are adjusted according to the data.
262262
/// * `alpha` - Additive (Laplace/Lidstone) smoothing parameter.
263263
/// * `binarize` - Threshold for binarizing.
264264
fn fit<TX: Number + PartialOrd, X: Array2<TX>, Y: Array1<TY>>(
@@ -402,10 +402,10 @@ impl<TX: Number + PartialOrd, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Arr
402402
{
403403
/// Fits BernoulliNB with given data
404404
/// * `x` - training data of size NxM where N is the number of samples and M is the number of
405-
/// features.
405+
/// features.
406406
/// * `y` - vector with target values (classes) of length N.
407407
/// * `parameters` - additional parameters like class priors, alpha for smoothing and
408-
/// binarizing threshold.
408+
/// binarizing threshold.
409409
pub fn fit(x: &X, y: &Y, parameters: BernoulliNBParameters<TX>) -> Result<Self, Failed> {
410410
let distribution = if let Some(threshold) = parameters.binarize {
411411
BernoulliNBDistribution::fit(
@@ -427,6 +427,7 @@ impl<TX: Number + PartialOrd, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Arr
427427

428428
/// Estimates the class labels for the provided data.
429429
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
430+
///
430431
/// Returns a vector of size N with class estimates.
431432
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
432433
if let Some(threshold) = self.binarize {

src/naive_bayes/categorical.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl<T: Number + Unsigned, X: Array2<T>, Y: Array1<T>> Predictor<X, Y> for Categ
363363
impl<T: Number + Unsigned, X: Array2<T>, Y: Array1<T>> CategoricalNB<T, X, Y> {
364364
/// Fits CategoricalNB with given data
365365
/// * `x` - training data of size NxM where N is the number of samples and M is the number of
366-
/// features.
366+
/// features.
367367
/// * `y` - vector with target values (classes) of length N.
368368
/// * `parameters` - additional parameters like alpha for smoothing
369369
pub fn fit(x: &X, y: &Y, parameters: CategoricalNBParameters) -> Result<Self, Failed> {
@@ -375,6 +375,7 @@ impl<T: Number + Unsigned, X: Array2<T>, Y: Array1<T>> CategoricalNB<T, X, Y> {
375375

376376
/// Estimates the class labels for the provided data.
377377
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
378+
///
378379
/// Returns a vector of size N with class estimates.
379380
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
380381
self.inner.as_ref().unwrap().predict(x)

src/naive_bayes/gaussian.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<TY: Number + Ord + Unsigned> GaussianNBDistribution<TY> {
175175
/// * `x` - training data.
176176
/// * `y` - vector with target values (classes) of length N.
177177
/// * `priors` - Optional vector with prior probabilities of the classes. If not defined,
178-
/// priors are adjusted according to the data.
178+
/// priors are adjusted according to the data.
179179
pub fn fit<TX: Number + RealNumber, X: Array2<TX>, Y: Array1<TY>>(
180180
x: &X,
181181
y: &Y,
@@ -317,7 +317,7 @@ impl<TX: Number + RealNumber, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Arr
317317
{
318318
/// Fits GaussianNB with given data
319319
/// * `x` - training data of size NxM where N is the number of samples and M is the number of
320-
/// features.
320+
/// features.
321321
/// * `y` - vector with target values (classes) of length N.
322322
/// * `parameters` - additional parameters like class priors.
323323
pub fn fit(x: &X, y: &Y, parameters: GaussianNBParameters) -> Result<Self, Failed> {
@@ -328,6 +328,7 @@ impl<TX: Number + RealNumber, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Arr
328328

329329
/// Estimates the class labels for the provided data.
330330
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
331+
///
331332
/// Returns a vector of size N with class estimates.
332333
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
333334
self.inner.as_ref().unwrap().predict(x)

src/naive_bayes/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ impl<TX: Number, TY: Number, X: Array2<TX>, Y: Array1<TY>, D: NBDistribution<TX,
8989

9090
/// Estimates the class labels for the provided data.
9191
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
92+
///
9293
/// Returns a vector of size N with class estimates.
9394
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
9495
let y_classes = self.distribution.classes();

src/naive_bayes/multinomial.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl<TY: Number + Ord + Unsigned> MultinomialNBDistribution<TY> {
208208
/// * `x` - training data.
209209
/// * `y` - vector with target values (classes) of length N.
210210
/// * `priors` - Optional vector with prior probabilities of the classes. If not defined,
211-
/// priors are adjusted according to the data.
211+
/// priors are adjusted according to the data.
212212
/// * `alpha` - Additive (Laplace/Lidstone) smoothing parameter.
213213
pub fn fit<TX: Number + Unsigned, X: Array2<TX>, Y: Array1<TY>>(
214214
x: &X,
@@ -345,10 +345,10 @@ impl<TX: Number + Unsigned, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Array
345345
{
346346
/// Fits MultinomialNB with given data
347347
/// * `x` - training data of size NxM where N is the number of samples and M is the number of
348-
/// features.
348+
/// features.
349349
/// * `y` - vector with target values (classes) of length N.
350350
/// * `parameters` - additional parameters like class priors, alpha for smoothing and
351-
/// binarizing threshold.
351+
/// binarizing threshold.
352352
pub fn fit(x: &X, y: &Y, parameters: MultinomialNBParameters) -> Result<Self, Failed> {
353353
let distribution =
354354
MultinomialNBDistribution::fit(x, y, parameters.alpha, parameters.priors)?;
@@ -358,6 +358,7 @@ impl<TX: Number + Unsigned, TY: Number + Ord + Unsigned, X: Array2<TX>, Y: Array
358358

359359
/// Estimates the class labels for the provided data.
360360
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
361+
///
361362
/// Returns a vector of size N with class estimates.
362363
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
363364
self.inner.as_ref().unwrap().predict(x)

src/neighbors/knn_classifier.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ impl<TX: Number, TY: Number + Ord, X: Array2<TX>, Y: Array1<TY>, D: Distance<Vec
261261

262262
/// Estimates the class labels for the provided data.
263263
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
264+
///
264265
/// Returns a vector of size N with class estimates.
265266
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
266267
let mut result = Y::zeros(x.shape().0);

src/neighbors/knn_regressor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ impl<TX: Number, TY: Number, X: Array2<TX>, Y: Array1<TY>, D: Distance<Vec<TX>>>
246246

247247
/// Predict the target for the provided data.
248248
/// * `x` - data of shape NxM where N is number of data points to estimate and M is number of features.
249+
///
249250
/// Returns a vector of size N with estimates.
250251
pub fn predict(&self, x: &X) -> Result<Y, Failed> {
251252
let mut result = Y::zeros(x.shape().0);

src/optimization/first_order/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
///
1+
/// Gradient descent optimization algorithm
22
pub mod gradient_descent;
3-
///
3+
/// Limited-memory BFGS optimization algorithm
44
pub mod lbfgs;
55

66
use std::clone::Clone;

0 commit comments

Comments
 (0)