mlxtend version: 0.23.1

Counter

Counter(stderr=False, start_newline=True, precision=0, name=None)

用于显示for循环迭代器进度的类.

Parameters

Attributes

Examples

    >>> cnt = Counter()
    >>> for i in range(20):
    ...     # 进行一些计算
    ...     time.sleep(0.1)
    ...     cnt.update()
    20 iter | 2 sec
    >>> print('计数器已初始化.'
    ' %d 秒前.' % (time.time() - cnt.start_time))
    计数器已初始化 2 秒前
    >>> print('计数器上次更新'
    ' %d 秒前.' % (time.time() - cnt.end_time))
    计数器上次更新 0 秒前.

    更多使用示例,请参见
    https://rasbt.github.io/mlxtend/user_guide/utils/Counter/

Methods


update()

打印当前迭代次数和经过的时间.

assert_raises

assert_raises(exception_type, message, func, args, *kwargs)

Check that an exception is raised with a specific message

Parameters

check_Xy

check_Xy(X, y, y_int=True)

None

format_kwarg_dictionaries

format_kwarg_dictionaries(default_kwargs=None, user_kwargs=None, protected_keys=None)

Function to combine default and user specified kwargs dictionaries

Parameters

Returns