forked from jindongwang/transferlearning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
19 lines (16 loc) · 535 Bytes
/
test.py
File metadata and controls
19 lines (16 loc) · 535 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#encoding=utf-8
"""
Created on 17:22 2017/5/1
@author: Jindong Wang
"""
import da_tool.tca
import numpy as np
file_path = 'data/test_tca_data.csv'
data = np.loadtxt(file_path, delimiter=',')
x_src = data[:, :81]
x_tar = data[:, 81:]
# example usage of TCA
my_tca = da_tool.tca.TCA(dim=30,kerneltype='rbf', kernelparam=1, mu=1)
x_src_tca, x_tar_tca, x_tar_o_tca = my_tca.fit_transform(x_src, x_tar)
np.savetxt('x_src1.csv', x_src_tca, delimiter=',', fmt='%.6f')
np.savetxt('x_tar1.csv', x_tar_tca, delimiter=',', fmt='%.6f')