b39db6e2bf0c806554578b5c9895d9b7ef6bd48c,Orange/statistics/util.py,,_count_nans_per_row_sparse,#Any#Any#,13

Before Change



def _count_nans_per_row_sparse(X, weights):
     Count the number of nans (undefined) values per row. 
    items_per_row = 1 if X.ndim == 1 else X.shape[1]
    counts = np.ones(X.shape[0]) * items_per_row
    nnz_per_row = np.bincount(X.indices, minlength=len(counts))
    counts -= nnz_per_row
    if weights is not None:
        counts *= weights
    return np.sum(counts)


def bincount(X, max_val=None, weights=None, minlength=None):
    Return counts of values in array X.

After Change



def _count_nans_per_row_sparse(X, weights):
     Count the number of nans (undefined) values per row. 
    counts = np.fromiter((np.isnan(row.data).sum() for row in X), dtype=np.float)

    if weights is not None:
        counts *= weights

    return counts


def bincount(X, max_val=None, weights=None, minlength=None):
    Return counts of values in array X.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: biolab/orange3
Commit Name: b39db6e2bf0c806554578b5c9895d9b7ef6bd48c
Time: 2017-09-09
Author: pavlin.g.p@gmail.com
File Name: Orange/statistics/util.py
Class Name:
Method Name: _count_nans_per_row_sparse


Project Name: tensorflow/models
Commit Name: 5fc4c351699c9007a727eaaef99413962cf0818f
Time: 2020-12-09
Author: hongkuny@google.com
File Name: official/nlp/modeling/layers/self_attention_mask.py
Class Name: SelfAttentionMask
Method Name: call


Project Name: automl/auto-sklearn
Commit Name: 1ec4287799a1ccfc019f564f3ce0de468de6e313
Time: 2015-04-09
Author: springj@informatik.uni-freiburg.de
File Name: ParamSklearn/implementations/ProjLogit.py
Class Name: ProjLogit
Method Name: predict