I have the following code
train_X, test_X, train_y, test_y = train_test_split(X.as_matrix(), y.as_matrix(), test_size=0.25)
where X
is a DataFrame and y
is a series.
When calling the function above, I get the following warning:
/opt/conda/lib/python3.6/site-packages/ipykernel_launcher.py:1: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
"""Entry point for launching an IPython kernel.
Then I tried to change using .values
as mentioned in the warning:
train_X, test_X, train_y, test_y = train_test_split(X.values(), y.values(), test_size=0.25)
But I get the following error:
TypeError Traceback (most recent call last) in () ----> 1 train_X, test_X, train_y, test_y = train_test_split(X.values(), y.values(), test_size=0.25)
TypeError: 'numpy.ndarray' object is not callable
How do I solve this?