Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced converters module, moved DR preprocessors to it, fixed exa…
…mples, updated other classes according to changes
- Loading branch information
Showing
75 changed files
with
734 additions
and
736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
examples/undocumented/python_modular/converter_diffusionmaps_modular.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from tools.load import LoadMatrix | ||
|
||
lm=LoadMatrix() | ||
data = lm.load_numbers('../data/fm_train_real.dat') | ||
|
||
parameter_list = [[data,10],[data,20]] | ||
|
||
def converter_diffusionmaps_modular(data,t): | ||
from shogun.Features import RealFeatures | ||
from shogun.Converter import DiffusionMaps | ||
from shogun.Kernel import GaussianKernel | ||
|
||
features = RealFeatures(data) | ||
|
||
converter = DiffusionMaps() | ||
converter.set_target_dim(1) | ||
converter.set_kernel(GaussianKernel(10,10.0)) | ||
converter.set_t(t) | ||
converter.apply(features) | ||
|
||
return features | ||
|
||
|
||
if __name__=='__main__': | ||
print 'DiffusionMaps' | ||
converter_diffusionmaps_modular(*parameter_list[0]) | ||
|
25 changes: 25 additions & 0 deletions
25
examples/undocumented/python_modular/converter_hessianlocallylinearembedding_modular.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from tools.load import LoadMatrix | ||
|
||
lm=LoadMatrix() | ||
data = lm.load_numbers('../data/fm_train_real.dat') | ||
|
||
parameter_list = [[data,10],[data,20]] | ||
|
||
def converter_hessianlocallylinearembedding_modular(data,k): | ||
from shogun.Features import RealFeatures | ||
from shogun.Converter import HessianLocallyLinearEmbedding | ||
|
||
features = RealFeatures(data) | ||
|
||
converter = HessianLocallyLinearEmbedding() | ||
converter.set_target_dim(1) | ||
converter.set_k(k) | ||
converter.apply(features) | ||
|
||
return features | ||
|
||
|
||
if __name__=='__main__': | ||
print 'HessianLocallyLinearEmbedding' | ||
converter_hessianlocallylinearembedding_modular(*parameter_list[0]) | ||
|
27 changes: 27 additions & 0 deletions
27
examples/undocumented/python_modular/converter_isomap_modular.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from tools.load import LoadMatrix | ||
|
||
lm=LoadMatrix() | ||
data = lm.load_numbers('../data/fm_train_real.dat') | ||
|
||
parameter_list = [[data]] | ||
|
||
def converter_isomap_modular(data): | ||
from shogun.Features import RealFeatures | ||
from shogun.Converter import Isomap | ||
|
||
features = RealFeatures(data) | ||
|
||
converter = Isomap() | ||
converter.set_landmark(True) | ||
converter.set_landmark_number(5) | ||
converter.set_k(6) | ||
converter.set_target_dim(1) | ||
converter.apply(features) | ||
|
||
return features | ||
|
||
|
||
if __name__=='__main__': | ||
print 'Isomap' | ||
converter_isomap_modular(*parameter_list[0]) | ||
|
Oops, something went wrong.