libtlda 0.1.5

Creator: bigcodingguy24

Last updated:

Add to Cart

Description:

libtlda 0.1.5

libTLDA: library of transfer learning and domain adaptation classifiers.

This package contains the following classifiers:

Importance-weighted classifier, with weight estimators:

Kernel density estimation
Ratio of Gaussians (Shimodaira, 2000)
Logistic discrimination (Bickel et al., 2009)
Kernel Mean Matching (Huang et al., 2006)
Nearest-neighbour-based weighting (Loog, 2015)


Transfer Component Analysis (Pan et al, 2009)
Subspace Alignment (Fernando et al., 2013)
Structural Correspondence Learning (Blitzer et al., 2006)
Robust Bias-Aware (Liu & Ziebart, 2014)
Feature-Level Domain Adaptation (Kouw et al., 2016)

Python-specific classifiers:

Target Contrastive Pessimistic Risk (Kouw et al., 2017)

Matlab-specific classifiers:

Geodesic Flow Kernel (Gong et al., 2012)

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.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.