feat: documents matrix methods
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//! use smartcore::tree::decision_tree_classifier::*;
|
||||
//!
|
||||
//! // Iris dataset
|
||||
//! let x = DenseMatrix::from_array(&[
|
||||
//! let x = DenseMatrix::from_2d_array(&[
|
||||
//! &[5.1, 3.5, 1.4, 0.2],
|
||||
//! &[4.9, 3.0, 1.4, 0.2],
|
||||
//! &[4.7, 3.2, 1.3, 0.2],
|
||||
@@ -604,7 +604,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn fit_predict_iris() {
|
||||
let x = DenseMatrix::from_array(&[
|
||||
let x = DenseMatrix::from_2d_array(&[
|
||||
&[5.1, 3.5, 1.4, 0.2],
|
||||
&[4.9, 3.0, 1.4, 0.2],
|
||||
&[4.7, 3.2, 1.3, 0.2],
|
||||
@@ -653,7 +653,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn fit_predict_baloons() {
|
||||
let x = DenseMatrix::from_array(&[
|
||||
let x = DenseMatrix::from_2d_array(&[
|
||||
&[1., 1., 1., 0.],
|
||||
&[1., 1., 1., 0.],
|
||||
&[1., 1., 1., 1.],
|
||||
@@ -687,7 +687,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn serde() {
|
||||
let x = DenseMatrix::from_array(&[
|
||||
let x = DenseMatrix::from_2d_array(&[
|
||||
&[1., 1., 1., 0.],
|
||||
&[1., 1., 1., 0.],
|
||||
&[1., 1., 1., 1.],
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//! use smartcore::tree::decision_tree_regressor::*;
|
||||
//!
|
||||
//! // Longley dataset (https://www.statsmodels.org/stable/datasets/generated/longley.html)
|
||||
//! let x = DenseMatrix::from_array(&[
|
||||
//! let x = DenseMatrix::from_2d_array(&[
|
||||
//! &[234.289, 235.6, 159., 107.608, 1947., 60.323],
|
||||
//! &[259.426, 232.5, 145.6, 108.632, 1948., 61.122],
|
||||
//! &[258.054, 368.2, 161.6, 109.773, 1949., 60.171],
|
||||
@@ -470,7 +470,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn fit_longley() {
|
||||
let x = DenseMatrix::from_array(&[
|
||||
let x = DenseMatrix::from_2d_array(&[
|
||||
&[234.289, 235.6, 159., 107.608, 1947., 60.323],
|
||||
&[259.426, 232.5, 145.6, 108.632, 1948., 61.122],
|
||||
&[258.054, 368.2, 161.6, 109.773, 1949., 60.171],
|
||||
@@ -540,7 +540,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn serde() {
|
||||
let x = DenseMatrix::from_array(&[
|
||||
let x = DenseMatrix::from_2d_array(&[
|
||||
&[234.289, 235.6, 159., 107.608, 1947., 60.323],
|
||||
&[259.426, 232.5, 145.6, 108.632, 1948., 61.122],
|
||||
&[258.054, 368.2, 161.6, 109.773, 1949., 60.171],
|
||||
|
||||
Reference in New Issue
Block a user