Skip to main content

A simple co-training library built on Keras.

Project description

A simple co-training library built with Keras.

  • Free software: MIT license

Installation

Before installing simple-co-train, please install one of Keras’ backend engines: TensorFlow, Theano, or CNTK.

pip install simple-co-train

Documentation

Basic usage:

from sctrain import CoTrainer, SelectionStrategy
from sctrain.results import print_results

trainer = CoTrainer(
    data_path='imdb.csv',  # this can be a directory, e.g. 'data'
    x_name='review',  # optional, defaults to 'text'
    y_name='sentiment',  # optional, defaults to 'label'
    unlabelled_size=0.9, # optional, what portion of total data should be used as unlabelled
    train_size=0.8, # optional, what portion of labelled data should be used as training data
    mapping={'negative': 0, 'positive': 1}  # optional mapping, y column must be 0 or 1
    selection = SelectionStrategy.UNSURE_ONLY # optional, can be CONFIDENT_ONLY or BOTH
)
# run the co-training, this may take a while...
trainer.run()
# print out accuracy, f1 score, precision, recall, and labelled samples at each co-training round
print_results(trainer)

Development

To run the all tests run:

tox

Note, to combine the coverage data from all the tox environments run:

Windows

set PYTEST_ADDOPTS=--cov-append
tox

Other

PYTEST_ADDOPTS=--cov-append tox

Changelog

0.1.0 (2020-05-07)

  • First release on PyPI.

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

simple-co-train-1.0.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

simple_co_train-1.0.0-py2.py3-none-any.whl (10.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file simple-co-train-1.0.0.tar.gz.

File metadata

  • Download URL: simple-co-train-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for simple-co-train-1.0.0.tar.gz
Algorithm Hash digest
SHA256 629882f4575349411e184e51cd6baaaa3e8a53211e0ddb6dd357fd9f4941fc7e
MD5 fd7f385dd28feb1d340970ec163ecd95
BLAKE2b-256 1f0de7eacbbe813cda843df8001ce794ff42cf6815da284010ead6c7f92cd6fc

See more details on using hashes here.

File details

Details for the file simple_co_train-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: simple_co_train-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for simple_co_train-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bfbe7d54a33313bc3a6a2b84b47dd6eed78c954113102621db4e91d0d19d8dc6
MD5 ff5282dda06cda6d25c84a48d9acf022
BLAKE2b-256 12735dc7122014f80aa8447461f2e26525c1d717cad93df723d9d983c416899c

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