You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Silence UserWarning in ColumnTransformer._hstack #365
In [2]: pasteimportpandasaspdimportsklearn.composeimportsklearn.preprocessingfromsklearn.baseimportcloneimportdask.dataframeasddimportdask_ml.composeimportdask_ml.preprocessingdf=pd.DataFrame({"A": pd.Categorical(["a", "a", "b", "a"]), "B": [1.0, 2, 4, 5]})
ddf=dd.from_pandas(df, npartitions=2).reset_index(drop=True)
b=dask_ml.compose.make_column_transformer(
(["A"], dask_ml.preprocessing.OneHotEncoder(sparse=False)),
(["B"], dask_ml.preprocessing.StandardScaler()),
)
## -- End pasted text --In [3]: b.fit_transform(ddf).compute()
/Users/taugspurger/sandbox/dask/dask/dataframe/multi.py:608: UserWarning: Concatenatingdataframeswithunknowndivisions.
We'reassumingthattheindexesofeachdataframesarealigned. Thisassumptionisnotgenerallysafe.
warnings.warn("Concatenating dataframes with unknown divisions.\n"Out[3]:
A_aA_bB01.00.0-1.26491111.00.0-0.63245600.01.00.63245611.00.01.264911
The data are coming from the same source, so we just need to rely on the fact that individual estimators in the pipeline don't change the n_samples in a transform. This is usually true (it's true everywhere in scikit-learn AFAIK) but there are some contrib packages that change the number of samples. Regardless, things may still be OK, as long as the partitions don't change...
Activity