Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Define Search Param
- search_params = {
- 'n_components': [5, 6, 7, 8]
- ‘learning_method’: [‘online’,’batch’],
- ‘learning_decay’: [0.5, 0.7, 0.9],
- ‘learning_offset’: [1, 5, 10]
- }
- # Init the Model
- lda = LDA(random_state = 123)
- # Init Grid Search Class
- model = GridSearchCV(lda, param_grid = search_params)
- # Do the Grid Search
- model.fit(sessions_vectorized)
- #Pick the best model
- best_lda_model = model.best_estimator_
- best_lda_model.fit(sessions_vectorized)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement