9b292db701a05ec2748be18d51a8bc52b98c646c,mlxtend/evaluate/decision_regions.py,,plot_decision_regions,#Any#Any#Any#Any#Any#Any#Any#Any#Any#Any#,15

Before Change



    

    if isinstance(y, list):
        y_ary = np.array(y)
    else:
        y_ary = y
    for a in (X, y_ary):
        if not isinstance(a, np.ndarray):
            raise ValueError("%s must be a NumPy array." % a.__name__)

After Change


    

    // Check types
    if not isinstance(X, np.ndarray):
        raise ValueError("X must be a 2D NumPy array")
    if not isinstance(y, np.ndarray):
        raise ValueError("y must be a 1D NumPy array")
    if not np.issubdtype(y.dtype, np.integer):
        raise ValueError("y must have be an integer array. "
                         "Try passing the array as y.astype(np.integer)")

    if ax is None:
        ax = plt.gca()

    // check if test data is provided
    plot_testdata = True
    if not isinstance(X_highlight, np.ndarray):
        if X_highlight is not None:
            raise ValueError("X_highlight must be a NumPy array or None")
        else:
            plot_testdata = False

    if len(X.shape) != 2:
        raise ValueError("X must be a 2D array")
    if X.shape[1] > 2:
        raise ValueError("X cannot have more than 2 feature columns")
    elif isinstance(X_highlight, np.ndarray) and len(X_highlight.shape) > 2:
        raise ValueError("X_highlight must be a 2D array")
    elif len(y.shape) > 1:
        raise ValueError("y must be a 1D array")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: rasbt/mlxtend
Commit Name: 9b292db701a05ec2748be18d51a8bc52b98c646c
Time: 2016-07-14
Author: mail@sebastianraschka.com
File Name: mlxtend/evaluate/decision_regions.py
Class Name:
Method Name: plot_decision_regions


Project Name: J535D165/recordlinkage
Commit Name: f0abbde5a393b8781919a2c33474757c07cfee8f
Time: 2016-01-02
Author: jonathandebruinhome@gmail.com
File Name: recordlinkage/indexing.py
Class Name:
Method Name: _sortedneighbourhood


Project Name: scipy/scipy
Commit Name: 0420057a63473b42e714554e604a12e37e243a37
Time: 2018-06-30
Author: adibhar97@gmail.com
File Name: scipy/spatial/transform/rotation.py
Class Name: Rotation
Method Name: __init__