def METHOD_NAME(matrix):
    (n_rows, n_cols) = matrix.shape
    if isinstance(matrix, np.ndarray) or sparse.issparse(matrix):
        guess = (n_rows * n_cols * matrix.dtype.itemsize) + 1024
    elif isinstance(matrix, pd.DataFrame):
        guess = pd.DataFrame.memory_usage(matrix).values.sum()
    elif isinstance(matrix, pd.Series):
        guess = pd.Series.memory_usage(matrix)
    elif isinstance(matrix, pd.Categorical):
        guess = pd.Categorical.memory_usage(matrix)
    else:
        guess = 1
    # round up to nearest 1024 bytes
    guess = (guess + 0x400) & (~0x3FF)
    return guess