Remove Outliers
Parameters
Name
Type
Description
Is Optional
Example
ds = rasgo.get.dataset(id)
# Drop outliers using a manual threshold
ds2 = ds.remove_outliers(
target_column=["ORDERS", "CANCELLATIONS"],
method="threshold",
min_threshold=100,
max_threshold=500,
drop=True
)
# Drop values with a Z-score > 2 (more than 2 standard deviations from the mean)
ds2 = ds.remove_outliers(
target_column=["ORDERS", "CANCELLATIONS"],
method="z-score"
drop=True,
max_zscore=2
)
# Flag outliers using the iqr method
ds2 = ds.remove_outliers(
target_column=["ORDERS"],
method="iqr"
drop=False
)
ds2.preview()Source Code
Last updated