python - How can one replace missing values with median or mode in SFrame? -
i'm going through graphlab documentation , trying figure out how duplicate pandas functionality na values replaced median, mean, or mode, etc... in pandas by: df.dropna().median() or df.dropna().mean() etc....
but documentation on dropna , fillna functions sframe don't mention similar. possible @ in sframe?
there one, mean available, not median. have at: graphlab.toolkits.feature_engineering.numericimputer
(doc)
impute missing values feature means.
input columns numericimputer must of type int, float, dict, list, or array.array. each column in input, transformed output column input retained if:
- there no missing value.
inputs not satisfy above set mean value of feature.
if median want, achieve with:
data.fillna('feature_name', np.median(data['feature_name']))
Comments
Post a Comment