Skip to main content

A Python package for Term Frequency - Binomial Seperation feature scaling

Project description

 Tfbns is an open source python library for Binomial Seperation Feature Scaling. BNS is an improved feature representation over Term Frequency - Inverse Document Frequency (TFIDF) representation for SVM Text classification. The implementation of the library is based on the paper: "Forman, G. (2008, October). BNS feature scaling: an improved representation over tf-idf for svm text classification. In Proceedings of the 17th ACM conference on Information and knowledge management (pp. 263-270)".

Usage:

from tfbns.feature_extraction import tfbns

	df = pd.read_csv("data.csv")
	tfbns_vectorizer = Tfbns()
	x_train = df['text'].to_numpy()
	y_train = df['label'].to_numpy() 
	#Label should be binary containing 0 or 1
	x_train_tfbns = tfbns.fit_transform(x_train, y_train)
	x_test_tfbns = tfbns.transform(x_test)

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

tfbns-0.0.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

tfbns-0.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file tfbns-0.0.3.tar.gz.

File metadata

  • Download URL: tfbns-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for tfbns-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1e18168ce82a39d5ed980d83bafed6502a6dcea1fc1ff2dedaeb80e00608245a
MD5 91391abcddf44f9dfafea97337cb2a04
BLAKE2b-256 271349883ae603c89a60f30e7cde78743355031558ec28656e576d81a36ad8d9

See more details on using hashes here.

File details

Details for the file tfbns-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: tfbns-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for tfbns-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 eddc2b02e2decad0c6713f1b1cc4b95bef0a27b473afb163be0084c414a3622f
MD5 30d58f7252a6a0dfca6882456c2bcd97
BLAKE2b-256 5af4773949fcac4883954550658a18afe11fba8820dde4cf4f9aa11619ce5362

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