用法:
class dask_ml.preprocessing.BlockTransformer(func: Callable[[...], Union[dask_ml._typing.ArrayLike, pandas.core.frame.DataFrame, dask.dataframe.core.DataFrame]], *, validate: bool = False, **kw_args: Any)
從任意可調用對象構造一個轉換器
BlockTransformer 將 X 參數的塊轉發給用戶定義的可調用對象並返回此操作的結果。這對於可以在單元或塊級別執行的無狀態操作很有用,例如獲取頻率日誌。一般來說,轉換器不適合例如標準化任務,因為這需要完整列的信息。
- func:可調用的
用於轉換的可調用對象。
- validate:布爾,可選默認=假
指示在調用之前應檢查輸入 X 數組
func
。- kw_args:字典,可選
要傳遞給 func 的附加關鍵字參數字典。
參數:
例子:
>>> import dask.datasets >>> import pandas as pd >>> from dask_ml.preprocessing import BlockTransformer >>> df = dask.datasets.timeseries() >>> df ... Dask DataFrame Structure: id name x y npartitions=30 2000-01-01 int64 object float64 float64 2000-01-02 ... ... ... ... ... ... ... ... ... 2000-01-30 ... ... ... ... 2000-01-31 ... ... ... ... Dask Name: make-timeseries, 30 tasks >>> trn = BlockTransformer(pd.util.hash_pandas_object, index=False) >>> trn.transform(df) ... Dask Series Structure: npartitions=30 2000-01-01 uint64 2000-01-02 ... ... 2000-01-30 ... 2000-01-31 ... dtype: uint64 Dask Name: hash_pandas_object, 60 tasks
相關用法
- Python dask_ml.preprocessing.MinMaxScaler用法及代碼示例
- Python dask_ml.preprocessing.Categorizer用法及代碼示例
- Python dask_ml.preprocessing.OrdinalEncoder用法及代碼示例
- Python dask_ml.preprocessing.LabelEncoder用法及代碼示例
- Python dask_ml.preprocessing.PolynomialFeatures用法及代碼示例
- Python dask_ml.preprocessing.StandardScaler用法及代碼示例
- Python dask_ml.preprocessing.QuantileTransformer用法及代碼示例
- Python dask_ml.preprocessing.RobustScaler用法及代碼示例
- Python dask_ml.preprocessing.DummyEncoder用法及代碼示例
- Python dask_ml.wrappers.ParallelPostFit用法及代碼示例
- Python dask_ml.feature_extraction.text.CountVectorizer用法及代碼示例
- Python dask_ml.linear_model.LinearRegression用法及代碼示例
- Python dask_ml.wrappers.Incremental用法及代碼示例
- Python dask_ml.metrics.mean_squared_log_error用法及代碼示例
- Python dask_ml.model_selection.GridSearchCV用法及代碼示例
- Python dask_ml.feature_extraction.text.FeatureHasher用法及代碼示例
- Python dask_ml.compose.ColumnTransformer用法及代碼示例
- Python dask_ml.ensemble.BlockwiseVotingClassifier用法及代碼示例
- Python dask_ml.model_selection.train_test_split用法及代碼示例
- Python dask_ml.decomposition.PCA用法及代碼示例
注:本文由純淨天空篩選整理自dask.org大神的英文原創作品 dask_ml.preprocessing.BlockTransformer。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。