sketched results reader - removed first tier learners optimization
This commit is contained in:
parent
174aa8ca05
commit
a95511b4d9
|
@ -85,7 +85,6 @@ if __name__ == '__main__':
|
|||
lXtr, lytr = data.training()
|
||||
lXte, lyte = data.test()
|
||||
|
||||
|
||||
if op.set_c != -1:
|
||||
meta_parameters = None
|
||||
else:
|
||||
|
@ -152,7 +151,7 @@ if __name__ == '__main__':
|
|||
config=config,
|
||||
first_tier_learner=get_learner(calibrate=True),
|
||||
meta_learner=get_learner(calibrate=False, kernel='rbf'),
|
||||
first_tier_parameters=get_params(dense=False),
|
||||
first_tier_parameters=None, # get_params(dense=False),-->first_tier should not be optimized
|
||||
meta_parameters=get_params(dense=True),
|
||||
n_jobs=op.n_jobs)
|
||||
|
||||
|
|
|
@ -220,6 +220,7 @@ class StorageEmbeddings:
|
|||
optimal_n = get_optimal_dim(self.lang_U, 'U')
|
||||
self.lang_U = run_pca(optimal_n, self.lang_U)
|
||||
elif max_label_space < nC:
|
||||
print(f'Applying PCA to unsupervised matrix U')
|
||||
self.lang_U = run_pca(max_label_space, self.lang_U)
|
||||
|
||||
return
|
||||
|
@ -258,7 +259,8 @@ class StorageEmbeddings:
|
|||
print(f'Applying PCA(n_components={i}')
|
||||
for lang in languages:
|
||||
self.lang_S[lang] = stacked_pca.transform(self.lang_S[lang])
|
||||
elif max_label_space < nC:
|
||||
elif max_label_space <= nC:
|
||||
print(f'Computing PCA on Supervised Matrix PCA(n_components:{max_label_space})')
|
||||
self.lang_S = run_pca(max_label_space, self.lang_S)
|
||||
|
||||
return
|
||||
|
@ -276,7 +278,6 @@ class StorageEmbeddings:
|
|||
self._add_emebeddings_supervised(docs, labels, config['reduction'], config['max_label_space'], vocs)
|
||||
return self
|
||||
|
||||
|
||||
def predict(self, config, docs):
|
||||
if config['supervised'] and config['unsupervised']:
|
||||
return self._concatenate_embeddings(docs)
|
||||
|
@ -289,4 +290,3 @@ class StorageEmbeddings:
|
|||
for lang in docs.keys():
|
||||
_r[lang] = docs[lang].dot(self.lang_U[lang])
|
||||
return _r
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
df = pd.read_csv("/home/andreapdr/funneling_pdr/src/results/results.csv", delimiter='\t')
|
||||
pivot = pd.pivot_table(df, values=['time', 'macrof1', 'microf1', 'macrok', 'microk'], index=['embed'], aggfunc=[np.mean, np.std])
|
||||
print(pivot)
|
||||
print('Finished ...')
|
|
@ -0,0 +1,2 @@
|
|||
def fill_missing_classes(lXtr, lytr):
|
||||
pass
|
Loading…
Reference in New Issue