vDataFrame[].fill_outliers¶
In [ ]:
vDataFrame[].fill_outliers(method: str = "winsorize",
threshold: float = 4.0,
use_threshold: bool = True,
alpha: float = 0.05)
Fills the vcolumns outliers using the input method.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
method | str | ✓ | Method to use to fill the vcolumn outliers.
|
threshold | float | ✓ | Uses the Gaussian distribution to define the outliers. After normalizing the data (Z-Score), if the absolute value of the record is greater than the threshold it will be considered as an outlier. |
use_threshold | bool | ✓ | Uses the threshold instead of the 'alpha' parameter. |
alpha | float | ✓ | Number representing the outliers threshold. Values lesser than quantile(alpha) or greater than quantile(1-alpha) will be filled. |
In [70]:
from verticapy.datasets import load_market
market = load_market().filter("Price < 0.7")
display(market.head(20))
In [66]:
# All the outliers (abs(ZSCORE) > 1.5) will be replaced by the NULL values
market["Price"].fill_outliers(method = "null",
threshold = 1.5,
use_threshold = True)
Out[66]:
In [69]:
# All the outliers (abs(ZSCORE) > 1.5) will be replaced by the lower and
# upper bound having a ZSCORE = 1.5 and -1.5
market["Price"].fill_outliers(method = "winsorize",
threshold = 1.5,
use_threshold = True)
Out[69]:
In [71]:
# All the outliers (values > quantile(0.8) or < quantile(0.8)) will be
# replaced by the nearest of the two quantiles
market["Price"].fill_outliers(method = "winsorize",
alpha = 0.2,
use_threshold = False)
Out[71]:
See Also¶
| vDataFrame[].drop_outliers | Drops the vcolumn outliers. |
| vDataFrame.outliers | Computes the vDataFrame Global Outliers. |
