mle_coerce | R Documentation |
One can use this function for a quick, ad hoc discretisation of numerical features in a data frame, so that it could be passed to vistla
using the maximal likelihood estimation (mle, the default).
This can be used to simulate legacy behaviour of vistla, which was to automatically perform such conversion with 10 equal-width bins.
The non-numeric columns are left as they were, hence this function is idempotent and does nothing when given fully discrete data.
mle_coerce(x, bins = 3, equal = c("size", "width"))
x |
Data frame to be converted. |
bins |
Number of bins to cut each numerical column into. |
equal |
If given |
A copy of x
, in which numerical columns have been discretised.
While convenient, this function does not necessary provide optimal quantisation of the data (in terms of future vistla performance); especially the bins parameter should be adjusted to the input data, either via optimisation or based on the known properties of the input or mechanisms behind it.
## Not run:
data(cchain)
vistla(Y~.,data=mle_coerce(cchain,3,"size"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.