[][src]Function bhtsne::load_csv

pub fn load_csv(
    file_path: &str,
    has_headers: bool,
    has_target: bool,
    target_hd: &str,
    target_col: usize
) -> (Vec<f64>, Option<Vec<String>>)

Loads data from a csv file.

Arguments

  • file_path - An &str that specifies the path of the file to load the data from.

  • has_headers - A bool value that specifies if the file has headers or not. if has_headers and has_target are set to true the function will locate the column specified by target_hd and will parse all of that column's records as data labels thus putting them in the second vector of the result's pair; in this case target_col will be ignored. If has_headers is set to false and has_target is specified, target_col will be used for the same purpose. When the csv has no target and no headers has_headersmust be set to false or else the first record of the file won't be parsed.

  • has_target - A bool value that specifies if the file has a target column or not.

  • target_hd - An &str that specifies the target header of the file.

  • target_col - A usize that specifies the target column of the file.