Код:
n_topics = [4, 6, 8, 10, 20]
log_likelyhoods_5 = [round(gscore.mean_validation_score) for gscore in model.grid_scores_ if gscore.parameters['learning_decay']==0.5]
log_likelyhoods_7 = [round(gscore.mean_validation_score) for gscore in model.grid_scores_ if gscore.parameters['learning_decay']==0.7]
log_likelyhoods_9 = [round(gscore.mean_validation_score) for gscore in model.grid_scores_ if gscore.parameters['learning_decay']==0.9]
Выход:
Ошибка: ----------------------- -------------------------------------------------- - AttributeError Traceback (последний вызов был последним) в 1 # Получить журнал вероятностей из результатов поиска по сетке 2 n_topics = [4, 6, 8, 10, 20] ----> 3 log_likelyhoods_5 = [round (gscore.mean_validation_score) для gscore в model.grid_scores_ if gscore.parameters ['learning_decay'] == 0.5] 4 log_likelyhoods_7 = [round (gscore.mean_validation_score) для gscore в model.grid_scores_ if gscore.parameters ['learning_decay'] == 0,7] 5 log9likely [round (gscore.mean_validation_score) для gscore в model.grid_scores_ if gscore.parameters ['learning_decay'] == 0.9] AttributeError: у объекта 'GridSearchCV' нет атрибута 'grid_scores _'