Skip to content

Commit

Permalink
update the readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
samanemami committed Mar 24, 2022
1 parent 80567e5 commit 6f6e436
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 26 deletions.
6 changes: 3 additions & 3 deletions Examples/Multioutput/MO.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def df(name, d):
return X, y


X, y = df(name, d)[0], df(name, d)[1]
X, y = df(name, d)


model_gbnn = GNEGNERegressor(total_nn=200,
Expand Down Expand Up @@ -75,7 +75,7 @@ def df(name, d):
random_state=random_state,
n_cv_general=3,
n_cv_intrain=3,
title=name + '_GBNN_MO_',
title=name + '_GBNN_'
)

gridsearch(X=X,
Expand All @@ -87,5 +87,5 @@ def df(name, d):
random_state=random_state,
n_cv_general=3,
n_cv_intrain=3,
title=name + '_NN_',
title=name + '_NN_'
)
15 changes: 14 additions & 1 deletion Examples/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
# Dataset implementation
# Example

This package contains the related experiments to the results of the paper. The comparison had done between two proposed GBNNN-Multioutput and GBNN-SingleOutput and neural networks.
We considered more than 18 datasets for these experiments, and you can access the dataset from the corresponding directory.

# Multioutput

This folder contains the implementation of the Multioutput experiments with the GBNN-MO and NN model.
It illustrates one dataset as an example. You can expand it for all the used datasets.

# Singleoutput
This folder contains the implementation of the Multioutput experiments with the GBNN-SO.
It illustrates one dataset as an example. You can expand it for all the used datasets.
## Dataset

This directory contains the example of using 17 multioutput regression datasets. I considered MTR datasets for the experiments. The path to clone the dataset and the number of features and missing values are included. The approaches to deal with the missing values are also mentioned in the txt file.

Expand Down
22 changes: 3 additions & 19 deletions Examples/Singleoutput/Gridsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def gridsearch(X, y, model, grid,

cv_results_test = np.zeros((n_cv_general, 1))
cv_results_generalization = np.zeros((n_cv_general, 1))
best_index_time = np.zeros((n_cv_general, 2))
bestparams = []
cv_results = []
pred = np.zeros_like(y)
Expand Down Expand Up @@ -59,10 +58,6 @@ def gridsearch(X, y, model, grid,
'mean_test_score'][grid_search.best_index_]
cv_results_generalization[cv_i, 0] = grid_search.cv_results_[
'final_test_error']
best_index_time[cv_i, 0] = grid_search.cv_results_[
'mean_fit_time'][grid_search.best_index_]
best_index_time[cv_i, 1] = grid_search.cv_results_[
'mean_score_time'][grid_search.best_index_]

results = {}
results['Metric'] = [
Expand All @@ -75,27 +70,16 @@ def gridsearch(X, y, model, grid,
cv_results_generalization, axis=0)
results['Std_generalization_score'] = np.std(
cv_results_generalization, axis=0)
results['mean_fit_time'] = np.mean(
best_index_time[:, 0], axis=0)
results['std_fit_time'] = np.std(
best_index_time[:, 0], axis=0)
results['mean_score_time'] = np.mean(
best_index_time[:, 1], axis=0)
results['std_scoret_time'] = np.std(
best_index_time[:, 1], axis=0)

pd.DataFrame(results).to_csv(
title + scoring_functions + '_Summary.csv')
pd.DataFrame(cv_results).to_csv(
title + scoring_functions + '_CV_results.csv')
pd.DataFrame(bestparams).to_csv(
title + scoring_functions + '_Best_Parameters.csv')
pd.DataFrame(best_index_time, columns=["Fit_time", "Score_time"]).to_csv(
title + 'Best_Index_time.csv')
title + scoring_functions + '_Parameters.csv')

np.savetxt(title + 'predicted_values.csv', pred, delimiter=',')
np.savetxt(title + '_predicted_values.csv', pred, delimiter=',')
rm = {}
rm['mean '] = np.mean(rmse, axis=0)
rm['std '] = np.std(rmse, axis=0)

pd.DataFrame(rm, index=['rmse']).to_csv(title + 'RMSE_' + 'score.csv')
pd.Series(rm).to_csv(title + '_RMSE_' + 'score.csv')
2 changes: 1 addition & 1 deletion Examples/Singleoutput/SO.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ def df(name, d):
random_state=random_state,
n_cv_general=3,
n_cv_intrain=3,
title=name[:-5] + "target_" + str(i) + '_GBNN_SO_',
title=name[:-5] + "_GBNN_SO_target" + str(i),
)
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
# Multioutput_GBNN
Multioutput GBNN examples
# Multivariate Gradient Boosted Neural Network

# About
The focus of this package is to provide related examples of the paper's experiments and results. You can reproduce our paper's results with the help of this package.

# install
To run the examples of this package, you have to install the GBNN package from [here](https://github.com/GAA-UAM/GBNN).
`pip install GBNN`
# Citation
If you are using this package, please cite it as below.

```yaml
References:
Type: article
Authors:
- Seyedsaman Emami
- Gonzalo Martínez-Muñoz
Arxiv:
- https://arxiv.org/abs/1909.12098
-
Keywords:
- Gradient Boosting
- "Neural Network"
```
## Key members of Multivariate Gradient Boosted Neural Network
* [Gonzalo Martínez-Muñoz](https://github.com/gmarmu)
* [Seyedsaman Emami](https://github.com/samanemami)
# Version
0.0.1
## Updated
2022-04-24
# Date-released
2022-01-01

0 comments on commit 6f6e436

Please sign in to comment.