Skip to main content

Optuna Class Weight Cost-Sensitive Learning

Project description

Cost Sensitive Learning

This is an Extended research from CTGAN-ENN, on algorithm-level approach by fine tuning class-weight using optuna, the supported model are SVM, Random Forest and LightBGM (other models come soon), the classifier model will run with the best class_weight parameter

Instalation

pip install classWeightLearn

Example Usage

from classWeightLearn import find_best_class_weight

best_weight_svc = find_best_class_weight(X, y, model_name='svc', n_trials=1)
classifier = SVC(class_weight=best_weight_svc)

Variables

  • X : all features of your dataset
  • y : target label of your dataset
  • model_name : supported models are (svc, lightgbm and random_forest)
  • n_trials : the number of trial that optuna will run (default:1)

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

classWeightLearn-1.0.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

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

classWeightLearn-1.0.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file classWeightLearn-1.0.0.tar.gz.

File metadata

  • Download URL: classWeightLearn-1.0.0.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for classWeightLearn-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e399a3d13f6ffc5004d7d31aafea1e6d21a6bad4600639384b7cab586e7f5ae3
MD5 dbbc2230ad5f7255a30875ff0a73d890
BLAKE2b-256 b197417121b10f560384d6cfa2215465f8f207931461c81d6f54600624e32d24

See more details on using hashes here.

File details

Details for the file classWeightLearn-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for classWeightLearn-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7395ad1c91253d1ebbb7fa4f5831de5bfda5c691f35fdb3d317656e820acde9
MD5 213b2a4d67640ec96a7c280c63cb2d19
BLAKE2b-256 0fb9d5e1e8a335eb9bbba45fa09abdf81f985fc263d6b2418c7937642d4eed3e

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