我嘗試使用 GeneticSelectionCV 和 sklearn 構建一個 mlp 分類器。我將 max_iter 固定為 25000。現在我想知道確切的迭代次數。我使用的代碼如下所示。
from genetic_selection import GeneticSelectionCV
import pandas as pds
import numpy as num
from sklearn.neural_network import MLPClassifier
X = X_train
y = y_train
estimators = MLPClassifier(solver='lbfgs', alpha=1e-5, random_state=1, max_iter=25000)
mlp = GeneticSelectionCV(
estimators, cv=5, verbose=0,
scoring="accuracy", max_features=24,
n_population=50, crossover_proba=0.5,
mutation_proba=0.2, n_generations=100,
crossover_independent_proba=0.5,
mutation_independent_proba=0.04,
tournament_size=3, n_gen_no_change=10,
caching=True, n_jobs=-1)
mlp = mlp.fit(X, y)
uj5u.com熱心網友回復:
如檔案中所列,求解器運行的實際迭代次數存盤在估計器的n_iter_屬性中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/456588.html
