tp3_solutions.py 文件源码

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

项目:TPs 作者: DataMiningP7 项目源码 文件源码
def get_train_test_sets(X, y):
    """ Split X and y into a train and a test sets.

    Args:
        X: the TF-IDF matrix where each line represents a document and each
           column represents a word, typically obtained by running
           transform_text() from the TP2.
        y: a binary vector where the i-th value indicates whether the i-th is a
           spam or a ham.
    Returns:
        X_train: train subset of X
        X_test: test subset of X
        y_train: train subset of y
        y_test: test subset of y
    """
    return train_test_split(X, y)

# Ex4.2, 4.3, 4.4
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号