Skip to main content

libTLDA: library of transfer learning and domain adaptation classifiers.

BuildStatus PyPI version Python version Matlab version DOI

This package contains the following classifiers:

Python-specific classifiers:

Matlab-specific classifiers:

Python

Installation

Installation can be done through pip:

pip install libtlda

Environment management is generally a good idea. To create a conda environment, run the following commands:

conda env create -f environment.yml
source activate libtlda

Usage

Libtlda follows a similar logic as scikit-learn. Each type of adaptive classifier is a submodule, from which the classifiers can be imported:

from libtlda.iw import ImportanceWeightedClassifier
from libtlda.tca import TransferComponentClassifier
from libtlda.suba import SubspaceAlignedClassifier
from libtlda.scl import StructuralCorrespondenceClassifier
from libtlda.rba import RobustBiasAwareClassifier
from libtlda.flda import FeatureLevelDomainAdaptiveClassifier
from libtlda.tcpr import TargetContrastivePessimisticClassifier

From there on, training is a matter of calling the fit method on your labeled source dataset (X,y) and unlabeled target dataset Z. For example:

classifier = ImportanceWeightedClassifier().fit(X, y, Z)

Predictions can be made by calling the predict method:

y_pred = classifier.predict(Z)

Documentation will be improved soon. For now, have a look at the example.py script. It shows a couple of options for training adaptive classifiers.

Matlab

Installation:

First clone the repository and change directory to matlab:

git clone https://github.com/wmkouw/libTLDA
cd libTLDA/matlab/

In the matlab command window, call the installation script. It downloads all dependencies (minFunc, libsvm) and adds them - along with libtlda - to your path:

install.m

Usage

There is an example script that can be edited to test the different classifiers:

example.m

Contact:

Questions, comments and bugs can be submitted in the issues tracker.

Metadata

Release files for libtlda 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libtlda 0.1.5
File Size Uploaded
libtlda-0.1.5.tar.gz 21.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libtlda 0.1.5
File Interpreter ABI Platform
libtlda-0.1.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 48.4 kB

Release files / libtlda-0.1.5.tar.gz

Download URL libtlda-0.1.5.tar.gz
Size 21.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bced8970689182234488deba3f1c1221b332668fc2a9420b1243317cce715d58
BLAKE2b-256 checksum
How to use checksums
35faa0d2f6457b44dd8e58a3b736f889f9f49b03b9796b1c44b358652af4390a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / libtlda-0.1.5-py2.py3-none-any.whl

Download URL libtlda-0.1.5-py2.py3-none-any.whl
Size 27.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2b6c5cdbbd76276eb07c35371edd90a2e0a573c9d2f7fbc736a00230adfde47a
BLAKE2b-256 checksum
How to use checksums
5a01a6137ff9bb4c9adf41e708fda3e2ed41c3a2ec29a1346dd2dc47a8b884e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page