Normalizes the input data using the specified norm.
Args:
X: (numpy.ndarray) - The input data to be normalized.
norm: (str), optional - The type of norm to use for normalization (default is 'l2').
Options:
- 'l2': L2 normalization (Euclidean norm).
- 'l1': L1 normalization (Manhattan norm).
- 'max': Max normalization (divides by the maximum absolute value).
- 'minmax': Min-max normalization (scales to [0, 1]).
Returns:
X: (numpy.ndarray) - The normalized data.
One-hot encodes non-numerical columns in a DataFrame or numpy array.
Drops the original columns after encoding.
Args:
X: (pandas.DataFrame or numpy.ndarray) - The data to be encoded.
cols: (list), optional - The list of column indices to be encoded (default is None).
If None, all non-numerical columns will be encoded.
Returns:
X: (pandas.DataFrame or numpy.ndarray) - The data with one-hot encoded columns.