pub struct ColumnMapping {
pub transaction_id: usize,
pub item_columns: Vec<usize>,
pub timestamp: usize,
pub field_separator: String,
}Expand description
Column mapping configuration for flexible data loading
Allows you to specify which columns to mine from your data, supporting multiple fields combined into patterns.
Fields§
§transaction_id: usizeColumn index for transaction/group ID (0-based)
item_columns: Vec<usize>Column indices for items to mine (supports multiple columns)
timestamp: usizeColumn index for timestamp (0-based)
field_separator: StringSeparator to combine multiple item columns (default: “::”)
Implementations§
Source§impl ColumnMapping
impl ColumnMapping
Sourcepub fn simple(
transaction_id: usize,
item_column: usize,
timestamp: usize,
) -> Self
pub fn simple( transaction_id: usize, item_column: usize, timestamp: usize, ) -> Self
Create mapping with transaction_id, single item column, and timestamp
§Example
use rust_rule_miner::data_loader::ColumnMapping;
// Mine product names from column 1
let mapping = ColumnMapping::simple(0, 1, 5);
// CSV: customer_id, product_name, category, price, location, timestamp
// 0 1 2 3 4 5Sourcepub fn multi_field(
transaction_id: usize,
item_columns: Vec<usize>,
timestamp: usize,
field_separator: String,
) -> Self
pub fn multi_field( transaction_id: usize, item_columns: Vec<usize>, timestamp: usize, field_separator: String, ) -> Self
Create mapping to mine multiple fields combined
§Example
use rust_rule_miner::data_loader::ColumnMapping;
// Mine product + category + location combined
let mapping = ColumnMapping::multi_field(
0, // customer_id (column 0)
vec![1, 2, 4], // product(1), category(2), location(4)
5, // timestamp (column 5)
"::".to_string() // separator
);
// CSV: customer_id, product, category, price, location, timestamp
// Results in items like: "Laptop::Electronics::US"Trait Implementations§
Source§impl Clone for ColumnMapping
impl Clone for ColumnMapping
Source§fn clone(&self) -> ColumnMapping
fn clone(&self) -> ColumnMapping
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ColumnMapping
impl RefUnwindSafe for ColumnMapping
impl Send for ColumnMapping
impl Sync for ColumnMapping
impl Unpin for ColumnMapping
impl UnwindSafe for ColumnMapping
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.