title: Scoring strategy of sklearn.model_selection.GridSearchCV for LatentDirichletAllocation
body: <p>I am trying to apply GridSearchCV on the LatentDirichletAllocation using the sklearn library. </p>
  
  <h2>Current pipeline looks like so:</h2>
  
  <pre><code>vectorizer = CountVectorizer(analyzer='word',       
                           min_df=10,                      
                           stop_words='english',           
                           lowercase=True,                 
                           token_pattern='[a-zA-Z0-9]{3,}'
                          )
  
  data_vectorized = vectorizer.fit_transform(doc_clean) #where doc_clean is processed text.
  
  lda_model = LatentDirichletAllocation(n_components =number_of_topics,
                                      max_iter=10,            
                                      learning_method='online',   
                                      random_state=100,       
                                      batch_size=128,         
                                      evaluate_every = -1,    
                                      n_jobs = -1,            
                                      )
  
  search_params = {'n_components': [10, 15, 20, 25, 30], 'learning_decay': [.5, .7, .9]}
  model = GridSearchCV(lda_model, param_grid=search_params)
  model.fit(data_vectorized)
  </code></pre>
  
  <p>Current the GridSearchCV uses the approximate log-likelihood as score to determine which is the best model. What I would like to do is to change my scoring method to be based on the <a href="http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.LatentDirichletAllocation.html#sklearn.decomposition.LatentDirichletAllocation.perplexity" rel="nofollow noreferrer"><i>approximate perplexity</i></a> of the model instead.</p>
  
  <p>According to sklearn's <a href="http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html" rel="nofollow noreferrer">documentation of GridSearchCV</a>, there is a scoring argument that I can use. However, I do not know how to apply perplexity as a scoring method, and I cannot find any examples online of people applying it. Is this possible?</p>