Updated docs [skip ci]

This commit is contained in:
Andrew Kane
2024-06-30 23:09:07 -07:00
parent b7c0e1e2ed
commit 0476d707a7

View File

@@ -27,7 +27,7 @@ impl Model {
Ok(Model { model }) Ok(Model { model })
} }
/// Returns the predicted value for a specific row and column. /// Returns the predicted value for a row and column.
pub fn predict(&self, row_index: i32, column_index: i32) -> f32 { pub fn predict(&self, row_index: i32, column_index: i32) -> f32 {
unsafe { mf_predict(self.model, row_index, column_index) } unsafe { mf_predict(self.model, row_index, column_index) }
} }
@@ -73,7 +73,7 @@ impl Model {
unsafe { std::slice::from_raw_parts((*self.model).q, (self.columns() * self.factors()) as usize) } unsafe { std::slice::from_raw_parts((*self.model).q, (self.columns() * self.factors()) as usize) }
} }
/// Returns the latent factors for a specific row. /// Returns the latent factors for a row.
pub fn p(&self, row_index: i32) -> Option<&[f32]> { pub fn p(&self, row_index: i32) -> Option<&[f32]> {
if row_index >= 0 && row_index < self.rows() { if row_index >= 0 && row_index < self.rows() {
let factors = self.factors(); let factors = self.factors();
@@ -84,7 +84,7 @@ impl Model {
None None
} }
/// Returns the latent factors for a specific column. /// Returns the latent factors for a column.
pub fn q(&self, column_index: i32) -> Option<&[f32]> { pub fn q(&self, column_index: i32) -> Option<&[f32]> {
if column_index >= 0 && column_index < self.columns() { if column_index >= 0 && column_index < self.columns() {
let factors = self.factors(); let factors = self.factors();