model.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:single-ways 作者: smart-ways 项目源码 文件源码
def NN_model(X, target):
    '''A perceptron classifier for classifying whether a route should be made
    one-way or not for a particular time-period. 

    Parameters
    ==========
    X : int
        An integer column matrix    

    The default algorithm ‘adam’ works pretty well on relatively large datasets
    (with thousands of training samples or more) in terms of both training time and validation score. For small datasets, however, ‘l-bfgs’ can converge faster and perform better.

    activation: logistic, the logistic sigmoid function, returns f(x) = 1 / (1 + exp(-x)).
    alpha: 0.0001 default
    learning_rate: 'constant'
    max_iter : int, optional, default 200
    tol : float, optional, default 1e-4

    '''
    y = [0, 1]
    clf = MLPClassifier(hidden_layer_sizes=(0, 0), activation='logistic', algorithm='l-bfgs',
                        early_stopping=True)
    clf.fit(X, y)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号