From 03b9f76e9f9a18910cd59c5859b21571e05bb559 Mon Sep 17 00:00:00 2001 From: gaxler Date: Mon, 1 Feb 2021 11:24:20 -0800 Subject: [PATCH] Doc+Naming Improvement --- src/preprocessing/categorical_encoder.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/preprocessing/categorical_encoder.rs b/src/preprocessing/categorical_encoder.rs index 7e71119..7a0f5d9 100644 --- a/src/preprocessing/categorical_encoder.rs +++ b/src/preprocessing/categorical_encoder.rs @@ -52,12 +52,12 @@ impl OneHotEncoderParams { } /// Calculate the offset to parameters to due introduction of one-hot encoding -fn find_new_idxs(num_params: usize, cat_sizes: &[usize], encoded_idxs: &[usize]) -> Vec { +fn find_new_idxs(num_params: usize, cat_sizes: &[usize], cat_idxs: &[usize]) -> Vec { // This functions uses iterators and returns a vector. // In case we get a huge amount of paramenters this might be a problem // todo: Change this such that it will return an iterator - let cat_idx = encoded_idxs.iter().copied().chain((num_params..).take(1)); + let cat_idx = cat_idxs.iter().copied().chain((num_params..).take(1)); // Offset is constant between two categorical values, here we calculate the number of steps // that remain constant @@ -103,8 +103,8 @@ pub struct OneHotEncoder { } impl OneHotEncoder { - /// PlaceHolder - + + /// Create an encoder instance with categories infered from data matrix pub fn fit>( data: &M, params: OneHotEncoderParams,