Skip to content

repair

repair_non_numeric(X, var_type)

Round non-numeric values to integers.

Parameters:

Name Type Description Default
X numpy.ndarray

X array

required
var_type list

list with type information

required
Source code in spotPython/utils/repair.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
def repair_non_numeric(X, var_type):
    """
    Round non-numeric values to integers.

    Args:
        X (numpy.ndarray): X array
        var_type (list): list with type information
    """
    for i in range(X.shape[1]):
        if var_type[i] != "num":
            X[:, i] = around(X[:, i])
    return X