tft.scale_to_z_score
Stay organized with collections
Save and categorize content based on your preferences.
Returns a standardized column with mean 0 and variance 1.
tft.scale_to_z_score(
x: common_types.ConsistentTensorType,
elementwise: bool = False,
name: Optional[str] = None,
output_dtype: Optional[tf.DType] = None
) -> common_types.ConsistentTensorType
Used in the notebooks
Scaling to z-score subtracts out the mean and divides by standard deviation.
Note that the standard deviation computed here is based on the biased variance
(0 delta degrees of freedom), as computed by analyzers.var.
Args |
x
|
A numeric Tensor , SparseTensor , or RaggedTensor .
|
elementwise
|
If true, scales each element of the tensor independently;
otherwise uses the mean and variance of the whole tensor.
|
name
|
(Optional) A name for this operation.
|
output_dtype
|
(Optional) If not None, casts the output tensor to this type.
|
Returns |
A Tensor , SparseTensor , or RaggedTensor containing the input column
scaled to mean 0
and variance 1 (standard deviation 1), given by: (x - mean(x)) / std_dev(x).
If x is floating point, the mean will have the same type as x . If x is
integral, the output is cast to tf.float32. If the analysis dataset is empty
or contains a single distinct value, then the input is returned without
scaling.
Note that TFLearn generally permits only tf.int64 and tf.float32, so casting
this scaler's output may be necessary.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-01 UTC."],[],[]]