zoukankan      html  css  js  c++  java
  • 输入数据的验证需要注意!!!

    Constructs a transformer from an arbitrary callable.

    A FunctionTransformer forwards its X (and optionally y) arguments to a user-defined function or function object and returns the result of this function. This is useful for stateless transformations such as taking the log of frequencies, doing custom scaling, etc.

    Note: If a lambda is used as the function, then the resulting transformer will not be pickleable.

    New in version 0.17.

    Read more in the User Guide.

    Parameters:
    func : callable, optional default=None
    The callable to use for the transformation. This will be passed the same arguments as transform, with args and kwargs forwarded. If func is None, then func will be the identity function.

    inverse_func : callable, optional default=None
    The callable to use for the inverse transformation. This will be passed the same arguments as inverse transform, with args and kwargs forwarded. If inverse_func is None, then inverse_func will be the identity function.

    validate : bool, optional default=True
    Indicate that the input X array should be checked before calling func. The possibilities are:

    If False, there is no input validation.
    If True, then X will be converted to a 2-dimensional NumPy array or sparse matrix. If the conversion is not possible an exception is raised.
    Deprecated since version 0.20: validate=True as default will be replaced by validate=False in 0.22.
    accept_sparse : boolean, optional
    Indicate that func accepts a sparse matrix as input. If validate is False, this has no effect. Otherwise, if accept_sparse is false, sparse matrix inputs will cause an exception to be raised.

    pass_y : bool, optional default=False
    Indicate that transform should forward the y argument to the inner callable.

    check_inverse : bool, default=True
    Whether to check that or func followed by inverse_func leads to the original inputs. It can be used for a sanity check, raising a warning when the condition is not fulfilled.

    New in version 0.20.

    kw_args : dict, optional
    Dictionary of additional keyword arguments to pass to func.

    inv_kw_args : dict, optional
    Dictionary of additional keyword arguments to pass to inverse_func.

  • 相关阅读:
    php模式设计之 工厂模式
    SDK以及部署的SDK的思路
    手机用fiddler抓包开发测试
    搭建GIT服务端
    TP5.0以上数据库增加数据异常
    lnmp一键安装后的配置改动建议
    TPshop5最新版 安装 nginx 开启PATHINFO 模式资源加载路径加载失败问题,适用tp3.2PATHINFO模式REWRITE模式
    jquery写拉动条
    JS(JQ)分页 个人查看,没注释
    ecshop 分页
  • 原文地址:https://www.cnblogs.com/wdmx/p/9930815.html
Copyright © 2011-2022 走看看