Package: vcosmos
spatial_domain.anomaly.O_SieveclassO_Sieve(data, column, tsf=1, bsf=1)O_Sieveis an outlier detection algorithm that utilizes a 3D projection of data points. It calculates distances of data points from a centre point in the 3D space, based on the squared values of the target column. The algorithm then determines upper and lower distance thresholds using a median-based approach. Data points that fall outside these thresholds are considered outliers. This class also provides methods for visualizing the data in the 3D space.What's new -Version release 1.0.2Added support forboxplots,Pre and Post Cleaningalong with theheliocentric slicing plotto perform better cleaning.Parameters:data:dataframeThedataon which the algorithm should be applied.column:strTarget column, the filtering is done based on this column.tsf:int or float, default=1Top scaling factor, the quantity with which the median distance must be multplied above the centre plane.bsf:int or float, default=1Bottom scaling factor, the quantity with which the median distance must be multplied below the centre plane.Installationpip install vcosmosUsageimportpandasaspdfromspatial_domain.anomalyimportO_Sieve# Reading a dataset using pandas.df=pd.read_csv('co2.csv')print(df.head)#   Make       Model Vehicle Class  Engine Size(L)  ...  Fuel Consumption Hwy (L/100 km) Fuel Consumption Comb (L/100 km) Fuel Consumption Comb (mpg)  CO2 Emissions(g/km)# 0  ACURA         ILX       COMPACT             2.0  ...                              6.7                              8.5                          33                  196# 1  ACURA         ILX       COMPACT             2.4  ...                              7.7                              9.6                          29                  221# 2  ACURA  ILX HYBRID       COMPACT             1.5  ...                              5.8                              5.9                          48                  136# 3  ACURA     MDX 4WD   SUV - SMALL             3.5  ...                              9.1                             11.1                          25                  255# 4  ACURA     RDX AWD   SUV - SMALL             3.5  ...                              8.7                             10.6                          27                  244# [5 rows x 12 columns]seive=O_Seive(df,'CO2 Emissions(g/km)',tsf=4.5,bsf=2)clean_data=seive.filtered_data()plot=seive.hcps_plot()print(clean_data.head())# Filtering Initiated....# Filtering Complete.# Ouliers Removed: 11#     Make       Model Vehicle Class  Engine Size(L)  ...  Fuel Consumption Hwy (L/100 km) Fuel Consumption Comb (L/100 km) Fuel Consumption Comb (mpg)  CO2 Emissions(g/km)# 0  ACURA         ILX       COMPACT             2.0  ...                              6.7                              8.5                          33                  196# 1  ACURA         ILX       COMPACT             2.4  ...                              7.7                              9.6                          29                  221# 2  ACURA  ILX HYBRID       COMPACT             1.5  ...                              5.8                              5.9                          48                  136# 3  ACURA     MDX 4WD   SUV - SMALL             3.5  ...                              9.1                             11.1                          25                  255# 4  ACURA     RDX AWD   SUV - SMALL             3.5  ...                              8.7                             10.6                          27                  244# [5 rows x 12 columns]