https://github.com/wmkouw/libtlda
Library of transfer learners and domain-adaptive classifiers.
https://github.com/wmkouw/libtlda
domain-adaptation machine-learning transfer-learning
Last synced: 6 months ago
JSON representation
Library of transfer learners and domain-adaptive classifiers.
- Host: GitHub
- URL: https://github.com/wmkouw/libtlda
- Owner: wmkouw
- License: mit
- Created: 2015-08-25T11:43:52.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T14:03:51.000Z (over 6 years ago)
- Last Synced: 2025-03-22T06:31:44.987Z (7 months ago)
- Topics: domain-adaptation, machine-learning, transfer-learning
- Language: Python
- Homepage:
- Size: 5.38 MB
- Stars: 90
- Watchers: 5
- Forks: 25
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# libTLDA
[](https://scrutinizer-ci.com/g/wmkouw/libTLDA/statistics/) [](https://travis-ci.org/wmkouw/libTLDA) [](https://libtlda.readthedocs.io/en/latest/) [](https://zenodo.org/badge/latestdoi/41360294)
## Library of transfer learners and domain-adaptive classifiers.
This package contains the following classifiers:
- Importance-weighting with ratios of Gaussians [(Shimodaira, 2000)](https://www.sciencedirect.com/science/article/pii/S0378375800001154)
- Importance-weighting with kernel density estimation [(Sugiyama \& Müller, 2005)](https://www.degruyter.com/dg/viewarticle/j$002fstnd.2005.23.issue-4_2005$002fstnd.2005.23.4.249$002fstnd.2005.23.4.249.xml)
- Importance-weighting with logistic discrimination [(Bickel et al., 2009)](http://www.jmlr.org/papers/v10/bickel09a.html)
- Kernel Mean Matching [(Huang et al., 2006)](https://papers.nips.cc/paper/3075-correcting-sample-selection-bias-by-unlabeled-data)
- Nearest-neighbour-based weighting [(Loog, 2015)](http://ieeexplore.ieee.org/document/6349714/)
- Transfer Component Analysis [(Pan et al, 2009)](http://ieeexplore.ieee.org/document/5640675/)
- Geodesic Flow Kernel [(Gong et al., 2012)](https://dl.acm.org/citation.cfm?id=1610094) (matlab-only)
- Subspace Alignment [(Fernando et al., 2013)](https://dl.acm.org/citation.cfm?id=1610094)
- Semi-supervised Subspace Alignment [(Yao et al., 2015)](https://www.cv-foundation.org/openaccess/content_cvpr_2015/html/Yao_Semi-Supervised_Domain_Adaptation_2015_CVPR_paper.html) (python-only)
- Structural Correspondence Learning [(Blitzer et al., 2006)](https://dl.acm.org/citation.cfm?id=1610094)
- Robust Bias-Aware Classification [(Liu & Ziebart, 2014)](https://papers.nips.cc/paper/5458-robust-classification-under-sample-selection-bias)
- Feature-Level Domain Adaptation [(Kouw et al., 2016)](http://jmlr.org/papers/v17/15-206.html)
- Target Contrastive Pessimistic Risk [(Kouw et al., 2017)](https://arxiv.org/abs/1706.08082) (python-only)## Python
#### Installation
Installation can be done through pip:
```shell
pip install libtlda
```The pip package installs all dependencies. To ensure that these dependencies that don't mess up your current python environment, you should set up a virtual environment. If you're using [conda](https://conda.io/docs/), this can be taken care of by running:
```
conda env create -f environment.yml
source activate libtlda
```#### Usage
LibTLDA follows a similar structure as [scikit-learn](http://scikit-learn.org/). There are several classes of classifiers that can be imported through for instance:
```python
from libtlda.iw import ImportanceWeightedClassifier
```With a data set of labeled source samples `(X,y)` and unlabeled target samples `Z`, the classifier can be called and trained using:
```python
clf = ImportanceWeightedClassifier(iwe='kmm')
clf.fit(X, y, Z)
```Given a trained classifier, predictions can be made as follows:
```python
predictions = clf.predict(Z)
```Check the [documentation](https://libtlda.readthedocs.io/en/latest/) for more information on specific classes, methods and functions.
## Matlab
#### Installation:
First clone the repository and change directory to matlab:
```shell
git clone https://github.com/wmkouw/libTLDA
cd libTLDA/matlab/
```In the matlab command window, call the installation script. It downloads all dependencies ([minFunc](https://www.cs.ubc.ca/~schmidtm/Software/minFunc.html), [libsvm](https://www.csie.ntu.edu.tw/~cjlin/libsvm/)) and adds them, along with `libtlda`, to your path:
```MATLAB
install.m
```#### Usage
There is an example script that can be edited to test the different classifiers:
```MATLAB
example.m
```## Contact:
Questions, comments and bugs can be submitted in the [issues tracker](https://github.com/wmkouw/libTLDA/issues). Any particular method / algorithm / technique that you feel should be included, can be submitted as an issue as well.