standard_scale
StandardScaleEstimator ¤
StandardScaleEstimator(
inputCol=None,
outputCol=None,
inputDtype=None,
outputDtype=None,
layerName=None,
maskValue=None,
)
Bases: BaseEstimator, SingleInputSingleOutputParams, MaskValueParams
Standard scaler estimator for use in Spark pipelines. This estimator is used to calculate the mean and standard deviation of the input feature column. When fit is called it returns a StandardScaleTransformer which can be used to standardize/transform additional features.
WARNING: If the input is an array, we assume that the array has a constant shape across all rows.
Initializes a StandardScaleEstimator estimator. Sets all parameters to given inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputCol
|
Optional[str]
|
Input column name to standardize. |
None
|
outputCol
|
Optional[str]
|
Output column name. |
None
|
inputDtype
|
Optional[str]
|
Input data type to cast input column to before transforming. |
None
|
outputDtype
|
Optional[str]
|
Output data type to cast the output column to after transforming. |
None
|
layerName
|
Optional[str]
|
Name of the layer. Used as the name of the tensorflow layer in the keras model. If not set, we use the uid of the Spark transformer. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
None - class instantiated. |
Source code in src/kamae/spark/estimators/standard_scale.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
compatible_dtypes
property
¤
compatible_dtypes
_fit ¤
_fit(dataset)
Fits the StandardScaleEstimator estimator to the given dataset. Calculates the mean and standard deviation of the input feature column and returns a StandardScaleTransformer with the mean and standard deviation set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
DataFrame
|
Pyspark dataframe to fit the estimator to. |
required |
Returns:
| Type | Description |
|---|---|
StandardScaleTransformer
|
StandardScaleTransformer instance with mean & standard deviation set. |
Source code in src/kamae/spark/estimators/standard_scale.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | |