您当前的位置: 首页 >  ui

段智华

暂无认证

  • 0浏览

    0关注

    1232博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

cs224u sst_02_hand_built_features Wrapper for LogisticRegression

段智华 发布时间:2020-05-11 21:42:09 ,浏览量:0

cs224u sst_02_hand_built_features Wrapper for LogisticRegression

上一篇博客(https://duanzhihua.blog.csdn.net/article/details/105981617)我们讲解了BasicSGDClassifier ,它在SST上做得很好!但我们可能不想依赖BasicSGDClassifier ,相反,我们希望依靠sklearn。下面是一个简单的sklearn.linear.model.LogisticRegression封装器,使用了build-dataset加载数据。 

def fit_softmax_classifier(X, y):    
    """Wrapper for `sklearn.linear.model.LogisticRegression`. This is 
    also called a Maximum Entropy (MaxEnt) Classifier, which is more 
    fitting for the multiclass case.
    
    Parameters
    ----------
    X : 2d np.array
        The matrix of features, one example per row.
    y : list
        The list of labels for rows in `X`.
    
    Returns
    -------
    sklearn.linear.model.LogisticRegression
        A trained `LogisticRegression` instance.
    
    """
    mod = L
关注
打赏
1659361485
查看更多评论
立即登录/注册

微信扫码登录

0.0437s