# Example: Standard usage with monotonicity
set.seed(123)
feature <- rnorm(1000)
target <- rbinom(1000, 1, plogis(2 * feature)) # Positive relationship
result <- ob_numerical_fast_mdlp(feature, target,
min_bins = 3,
max_bins = 6,
force_monotonicity = TRUE
)
print(result$bin)
print(result$woe) # Should show a monotonic trend
# Example: Disabling monotonicity for exploratory analysis
result_no_mono <- ob_numerical_fast_mdlp(feature, target,
min_bins = 3,
max_bins = 6,
force_monotonicity = FALSE
)
print(result_no_mono$woe) # May show non-monotonic patterns
Run the code above in your browser using DataLab