quantlab.model.collected_panel.as_feature_dtype#
- quantlab.model.collected_panel.as_feature_dtype(data)[source]#
Return
datawith every variable cast toFEATURE_DTYPE.A variable already of that type is kept as it is, not copied. Every variable is cast, integer ones included: the fit reads its features as
FEATURE_DTYPEwhatever their type.- Parameters:
- dataxr.Dataset
A feature panel.
- Returns:
- xr.Dataset
datawith every variable ofFEATURE_DTYPE;dataitself when every variable already is.
Examples
>>> wide = panel.assign(f_a=panel["f_a"].astype(np.float64)) >>> as_feature_dtype(wide)["f_a"].dtype dtype('float32')