Skip to main content

spatial_domain.anomaly.O_Sieve


class O_Sieve(data, column, tsf=1, bsf=1)


O_Sieve is 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.2

  • Added support for boxplots , Pre and Post Cleaning along with the heliocentric slicing plot to perform better cleaning.

Parameters:

  • data: dataframe

    • The data on which the algorithm should be applied.
  • column: str

    • Target column, the filtering is done based on this column.
  • tsf: int or float, default=1

    • Top scaling factor, the quantity with which the median distance must be multplied above the centre plane.
  • bsf : int or float, default=1

    • Bottom scaling factor, the quantity with which the median distance must be multplied below the centre plane.

Installation

pip install vcosmos

Usage

import pandas as pd
from spatial_domain.anomaly import O_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]

Metadata

Release files for vcosmos 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vcosmos 1.1.0
File Size Uploaded Provenance
vcosmos-1.1.0.tar.gz 4.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for vcosmos 1.1.0
File Interpreter ABI Platform
vcosmos-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / vcosmos-1.1.0.tar.gz

Download URL vcosmos-1.1.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
582ef02bb4bcd45cd473372d3d2e7415183feaab9e1d9b918eb0fac34b3eee1b
BLAKE2b-256 checksum
How to use checksums
2c68881368b37fd3c82e93958b4ab44b1896f180294cd71ee018d4a22d1f243b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release files / vcosmos-1.1.0-py3-none-any.whl

Download URL vcosmos-1.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0939b1c0b67d67c33f6669c4c75244894e5715dfb3ff360a179a29fd813f2e94
BLAKE2b-256 checksum
How to use checksums
efb30fb0754045a85ba38180a352eca0f3354212e862c57aaa68382ae56a89b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Security for vcosmos 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page