Skip to main content

A small package for LoRAS oversampling

Project description

LoRAS

Localized Randomized Affine Shadowsampling (LoRAS) oversampling technique

Installation

The latest version is available on PyPi and installable with the command: pip install loras

Usage

There is just one method fit_resample(maj_class_points, min_class_points, k, num_shadow_points, list_sigma_f, num_generated_points, num_aff_comb, random_state=42)

There are two mandatory inputs:

  • maj_class_points : Majority class parent data points which is a non-empty list containing numpy arrays acting as points
  • min_class_points : Minority class parent data points which is a non-empty list containing numpy arrays acting as points

There are also optional parameters:

  • k : Number of nearest neighbours to be considered per parent data point (default value: 8 if len(min_class_points)<100 else 30)
  • num_shadow_points : Number of generated shadowsamples per parent data point (default value: ceil(2*num_aff_comb / k))
  • list_sigma_f : List of standard deviations for normal distributions for adding noise to each feature (default value: [0.005, ... , 0.005])
  • num_generated_points : Number of shadow points to be chosen for a random affine combination (default value: ceil((len(maj_class_points) + len(min_class_points)) / len(min_class_points)))
  • num_aff_comb : Number of generated LoRAS points for each nearest neighbours group (default value: min_class_points.shape[1])

Output:

  • min_class_points::oversampled_set : Concatenation of original data points and oversampled ones

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

loras-0.0.22b0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loras-0.0.22b0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file loras-0.0.22b0.tar.gz.

File metadata

  • Download URL: loras-0.0.22b0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for loras-0.0.22b0.tar.gz
Algorithm Hash digest
SHA256 8e6e270cc0a2278864ad224e993a35fb7d15887f0e799061042c082f485cff82
MD5 eb9f2c7a61af7cd52c44386625edc127
BLAKE2b-256 c3d56a6564965b662254941260c7f77f9cf7612f26b00abc53eb72f924d464ed

See more details on using hashes here.

File details

Details for the file loras-0.0.22b0-py3-none-any.whl.

File metadata

  • Download URL: loras-0.0.22b0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.4

File hashes

Hashes for loras-0.0.22b0-py3-none-any.whl
Algorithm Hash digest
SHA256 58cdb0b38ec2e4476d2dff4db3331e5e6094644e97230542cd4a002a3ceb8993
MD5 e68bee682292e17de9002a8891b32758
BLAKE2b-256 b27b75a37b7cfe4e969f1ac068eacde1b95eb283cbd50baf9952671ed08089ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page