2017-10-30 20 views
0

私はここで何かが欠落していると思いますが、SklearnのMlp退行者は入力層と出力層のニューロン数をどのように計算または定義しますか?入力、出力層sklearn python

ドキュメントで説明が見つかりませんでした。

答えて

0

Skleanは、fitメソッド内の入力と出力のシェイプを定義します。 実際、のすべてのモデルはfitというメソッドを実装するクラスです。ここで

は、コードがsklearn.neural_network.MLPRegressorの場合のように見える方法は次のとおりです。

def fit(self, X, y): 
    """Fit the model to data matrix X and target(s) y. 
    Parameters 
    ---------- 
    X : array-like or sparse matrix, shape (n_samples, n_features) 
     The input data. 
    y : array-like, shape (n_samples,) or (n_samples, n_outputs) 
     The target values (class labels in classification, real numbers in 
     regression). 
    Returns 
    ------- 
    self : returns a trained MLP model. 
    """ 
    return self._fit(X, y, incremental=False) 

は、すべてが一緒にどのように機能するかをより深く理解するためにgithubでコードを確認してください。