@staticmethod<EOL><INDENT>def compose_input_data(x: List[Union[Tuple[Union[np.ndarray, list, spmatrix, str]],<EOL>List[Union[np.ndarray, list, spmatrix, str]],<EOL>np.ndarray, spmatrix]]) -> Union[spmatrix, np.ndarray]:<DEDENT>
x_features = []<EOL>for i in range(len(x)):<EOL><INDENT>if ((isinstance(x[i], tuple) or isinstance(x[i], list) or isinstance(x[i], np.ndarray) and len(x[i]))<EOL>or (issparse(x[i]) and x[i].shape[<NUM_LIT:0>])):<EOL><INDENT>if issparse(x[i][<NUM_LIT:0>]):<EOL><INDENT>x_features.append(vstack(list(x[i])))<EOL><DEDENT>elif isinstance(x[i][<NUM_LIT:0>], np.ndarray) or isinstance(x[i][<NUM_LIT:0>], list):<EOL><INDENT>x_features.append(np.vstack(list(x[i])))<EOL><DEDENT>elif isinstance(x[i][<NUM_LIT:0>], str):<EOL><INDENT>x_features.append(np.array(x[i]))<EOL><DEDENT>else:<EOL><INDENT>raise ConfigError('<STR_LIT>')<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ConfigError("<STR_LIT>")<EOL><DEDENT><DEDENT>sparse = False<EOL>for inp in x_features:<EOL><INDENT>if issparse(inp):<EOL><INDENT>sparse = True<EOL><DEDENT><DEDENT>if sparse:<EOL><INDENT>x_features = hstack(list(x_features))<EOL><DEDENT>else:<EOL><INDENT>x_features = np.hstack(list(x_features))<EOL><DEDENT>return x_features<EOL>
Stack given list of different types of inputs to the one matrix. If one of the inputs is a sparse matrix, \
    then output will be also a sparse matrix

Args:
    x: list of data elements

Returns:
    sparse or dense array of stacked data