Closed heitorrapela closed 3 years ago
This can already be accomplished by passing a sklearn.manifold.TSNE instance with the preferred defined parameters to the feature_extractor parameter of ImageTransformer. I am hesitant to add method specific parameters for the string feature_extractor options as there are many (tnse.metric, kernelpca.kernel, etc.). If anything, I plan to deprecate the use of strings for the feature_extractor parameter and allow only class instances - the use of a select set of strings initially added to keep the interface similar to the MatLab implementation.
from pyDeepInsight import ImageTransformer
from sklearn.manifold import TSNE
custom_tsne = TSNE(n_components=2, perplexity=30.0, metric='cosine')
it = ImageTransformer(feature_extractor=custom_tsne, pixels=50)
I see, thanks for the information about the passing the feature_extractor it is really useful. I will close the PR. Best regards,
Vary the perplexity parameter in TSNE is essential to have an useful image. For many problems the default value of the perplexity is not useful.