manya
manya

Reputation: 11

Name Error: _gradient_descent() got an unexpected keyword argument 'n_iter_check'

I am trying to reproduce the example for implementing the T- distributed Stochastic Neighbor Embedding or t-SNE algorithm from sklearn as described here.

On running the TSNE function I get this error:

TypeError: _gradient_descent() got an unexpected keyword argument 'n_iter_check'

Currently the t-SNE function does not have any n_iter_check argument so not sure what is the unexpected keyword argument.

The only online help I found was at this link

Anyone who has managed to work around this?

Upvotes: 1

Views: 1106

Answers (1)

far-zadeh
far-zadeh

Reputation: 145

Look at your sklearn module and find related function in tsne for gradient_descent.

You will find that it has two extra parameters that you have to initialize in your new function. There are two missing parameters: n_iter_check and kwargs

def _gradient_descent(objective, p0, it, n_iter, objective_error=None, n_iter_check=1, n_iter_without_progress=50, momentum=0.5, learning_rate=1000.0, min_gain=0.01, min_grad_norm=1e-7, min_error_diff=1e-7, verbose=0, args=None, kwargs=None):

Upvotes: 1

Related Questions