rapidsai / cuml

cuML - RAPIDS Machine Learning Library
https://docs.rapids.ai/api/cuml/stable/
Apache License 2.0
4.18k stars 527 forks source link

Random Forest Multioutput regressor cuML #4344

Open leo2105 opened 2 years ago

leo2105 commented 2 years ago

Hi, I have troubles to run a simple code of Random Forest Regressor Multioutput using cuML. It looks that curfr doesnt support multioutput

import cudf

import numpy as np
import pandas as pd

from cuml.ensemble import RandomForestRegressor as curfr
from cuml.metrics import accuracy_score

from sklearn.ensemble import RandomForestClassifier as skrfc
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split

n_samples = 2**12
n_features = 399
n_info = 300
random_state = 23

X,y = make_regression(n_samples=n_samples,
                          n_features=n_features,
                          n_informative=n_info,
                          random_state=123, n_targets=n_features)

X = cudf.DataFrame(X)
y = cudf.DataFrame(y)
X_cudf, X_cudf_test, y_cudf, y_cudf_test = train_test_split(X, y, test_size = 0.2, random_state=random_state)

cuml_model_regressor = curfr(bootstrap=False,
              max_depth=20,
              max_features='sqrt',
              min_samples_leaf=1,
              min_samples_split=2,
              n_estimators=2)
cuml_model_regressor.fit(X_cudf, y_cudf)

Output:

/opt/conda/envs/rapids/lib/python3.7/site-packages/cuml/common/input_utils.py in input_to_cuml_array(X, order, deepcopy, check_dtype, convert_to_dtype, safe_dtype_conversion, check_cols, check_rows, fail_on_order, force_contiguous) 396 if n_cols != check_cols: 397 raise ValueError("Expected " + str(check_cols) + --> 398 " columns but got " + str(n_cols) + " columns.") 399 400 if check_rows:

ValueError: Expected 1 columns but got 399 columns.

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

leo2105 commented 2 years ago

Hi, I would like to know if there is any news about this issue. thanks

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

jackbrucesimpson commented 2 years ago

Any updates on this? This is a complete deal breaker for me moving across from scikit-learn.