Skip to main content

Utilities for pandas.

Project description

PyPI-Status PyPI-Versions Build-Status Codecov LICENCE

scikit-learn wrappers for Python fastText.

>>> from skift import FirstColFtClassifier
>>> df = pandas.DataFrame([['woof', 0], ['meow', 1]], columns=['txt', 'lbl'])
>>> sk_clf = FirstColFtClassifier()
>>> sk_clf.fit(df[['txt']], df['lbl'])
>>> sk_clf.predict([['woof']])
[0]

1 Installation

Dependencies:

  • numpy

  • scikit-learn

  • fastText Python package

pip install skift

NOTICE: Installing skift will not install any of its dependencies. They should be install separately.

2 Features

  • Adheres to the scikit-learn classifier API, including predict_proba.

  • Caters to the common use case of pandas.DataFrame inputs.

  • Enables easy stacking of fastText with other types of scikit-learn-compliant classifiers.

  • Pickle-able classifier objects.

  • Pure python.

  • Supports Python 3.4+.

  • Fully tested.

3 Wrappers

skift includes several wrappers:

3.1 Standard wrappers

  • FirstColFtClassifier - An sklearn classifier adapter for fasttext that takes the first column of input ndarray objects as input.

  • IdxBasedFtClassifier - An sklearn classifier adapter for fasttext that takes input by index.

3.2 pandas-dependent wrappers

These wrappers assume the X parameters given to fit, predict, and predict_proba methods is a pandas.DataFrame object:

  • FirstObjFtClassifier - An sklearn adapter for fasttext using the first object column as input.

  • ColLblBasedFtClassifier - An sklearn adapter for fasttext taking input by column label.

4 Contributing

Package author and current maintainer is Shay Palachy (shay.palachy@gmail.com); You are more than welcome to approach him for help. Contributions are very welcomed.

4.1 Installing for development

Clone:

git clone git@github.com:shaypal5/skift.git

Install in development mode:

cd skift
pip install -e .

4.2 Running the tests

To run the tests use:

pip install pytest pytest-cov coverage
cd skift
pytest

4.3 Adding documentation

The project is documented using the numpy docstring conventions, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings. When documenting code you add to this project, follow these conventions.

5 Credits

Created by Shay Palachy (shay.palachy@gmail.com).

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

skift-0.0.3.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

skift-0.0.3-py2.py3-none-any.whl (10.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: skift-0.0.3.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for skift-0.0.3.tar.gz
Algorithm Hash digest
SHA256 874f6d3bc38bf412d74272ebbafc4c9bde4f998c0cbcb0e243f450ae73688c1a
MD5 bb9be1e79ca508c24d2de778ab5360c8
BLAKE2b-256 7ca9dae2ae8dd2dc9a15b53fa01cb9adfd3791aa759856682ba7c79bbb84b057

See more details on using hashes here.

File details

Details for the file skift-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for skift-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a466f96f84d66a6950b3dba25f5ca51c8986842a6ba4f84915e8d458253fd797
MD5 0ba5f3ddf70d867a7c57a597e0d49cf5
BLAKE2b-256 38cf33357da9049035509f9b780b5208299a87259f82aac8686ea72874a7686f

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