Open maryam3066 opened 4 years ago
@maryam3066 Hello,
The library currently only supports classification problems. Regression support will be added in future versions.
This repository is just a fork of the original one hosted on scikit-learn-contrib: So if you have any other questions or request, please open an issue in the main repository.
### Hi, I try to predict continuous variables (regression task not classification tasks). for example, I want to predict software effort estimation with dynamic ensemble algorithms like knorae . I use deslib library for this estimation. When I use knorae, it runs without any error and predicts some values. Like these codes:
train and prediction on knorae algorithm
data=arff.loadarff('maxwell.arff') df=pd.DataFrame(data[0]) from sklearn.model_selection import train_test_split from deslib.des import KNORAE X=df.drop('Effort',axis=1) y=df['Effort'] X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.33,random_state=rng) kne=KNORAE(random_state=rng) kne.fit(X_train,y_train) out:BaggingRegressor(base_estimator=None, bootstrap=True, bootstrap_features=False, max_features=1.0, max_samples=1.0, n_estimators=10, n_jobs=None, oob_score=False, random_state=None, verbose=0, warm_start=False) kne.predict(X_test) out:array([1520., 1450., 1520., 3600., 2330., 4150., 2330., 1100., 4557., 1060., 1450., 1060., 1745., 900., 4150., 3600., 1450., 4557., 1233., 1651., 4150.]) ### But when I use bagging regressor with knorae this error arises: from sklearn.ensemble import BaggingRegressor pool_regressor=BaggingRegressor() pool_regressor.fit(X_train,y_train) out:BaggingRegressor(base_estimator=None, bootstrap=True, bootstrap_features=False, max_features=1.0, max_samples=1.0, n_estimators=10, n_jobs=None, oob_score=False, random_state=None, verbose=0, warm_start=False) kne=KNORAE(pool_regressor,random_state=rng) kne.fit(X_train,y_train) OUT:KNORAE(DFP=False, DSEL_perc=0.5, IH_rate=0.3, k=7, knn_classifier='knn', pool_classifiers=BaggingRegressor(base_estimator=None, bootstrap=True, bootstrap_features=False, max_features=1.0, max_samples=1.0, n_estimators=10, n_jobs=None, oob_score=False, random_state=None, verbose=0, warm_start=False), random_state=RandomState(MT19937) at 0x238D368A360, safe_k=None, kne.predict(X_test) **OUT:IndexError Traceback (most recent call last)