A CascadeForestClassifier extension of AutoSklearn classifier
Project description
Deep Forest for Auto-Sklearn
Extension of AutoSklearnClassifier with DF21 - CascadeForestClassifier - a Deep Forest implementantion. Based on an example extension from Auto-Sklearn documentation.
Requirements
- Linux operating system (requirement of Auto-Sklearn)
- numpy version <= 1.19
- installation of CascadeForestClassifier
- installation of Auto-Sklearn
- input variables have to be converted to numeric without missing values
- output variables also should be converted to numeric values (you can use sklearn LabelEncoder)
Example use
# import libraries
import sklearn.metrics
import autosklearn.classification
import autosklearn.pipeline.components.classification
# import DFClassifier
from df_autosk.df_autosk import DFClassifier
# add DFClassifier to autosklearn classifier
autosklearn.pipeline.components.classification.add_classifier(DFClassifier)
# initialize and get hyperparameter search space
cs = DFClassifier.get_hyperparameter_search_space()
print(cs)
# load the dataset
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_breast_cancer
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
# use the classifier
clf = autosklearn.classification.AutoSklearnClassifier(
time_left_for_this_task=5400,
include={"classifier": ['DFClassifier']},
initial_configurations_via_metalearning=0,
memory_limit = 102400,
# Not recommended for a real implementation
smac_scenario_args={"runcount_limit": 2}
)
clf.fit(X_train, y_train)
#get result
y_pred = clf.predict(X_test)
print("accuracy: ", sklearn.metrics.accuracy_score(y_pred, y_test))
Example based on an example extension from Auto-Sklearn documentation.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
df_autosk-0.0.4.tar.gz
(4.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file df_autosk-0.0.4.tar.gz.
File metadata
- Download URL: df_autosk-0.0.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d83e425ce808c3423d38ec8186446765f4fd9627eeb425fe06e2cfed83138fa1
|
|
| MD5 |
2e85d18802f6325726a43a6f42832f71
|
|
| BLAKE2b-256 |
b345fa569560dda4edaa3ba595c44b340b42e446569aaa2fdff4f002124b8cc4
|
File details
Details for the file df_autosk-0.0.4-py3-none-any.whl.
File metadata
- Download URL: df_autosk-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7957bf4e831542448ec755087e3040d0b5678217f6b22b224c52628b375af39
|
|
| MD5 |
d11f8a6ff3ede555a3e2b240b8fed8f2
|
|
| BLAKE2b-256 |
1e25722c593730defe1467fdcc72b1180722b1be11f088466d5decfaedbdb5df
|