Welcome to examples of ai4water’ Experiments module!

Experiments

The basic purpose of the experiments module of ai4water is comparison. It can be used for following scenarios

  1. Comparison between different machine learning algorithms for a classification or regression task.

    This can be done using MLRegressionExperiments or MLClassificationExperiments class.

  2. Comparison between different neural network architectures for a classification or a regression task.

    This can be done using DLRegressionExperiments or DLClassificationExperiments classes.

  3. Test a single algorithm in different scenarios e.g., by applying different transformations on a feature and compare the results

    A use case is shown with TransformationExperiments class.

  4. Optimize the hyperparameters of multiple models. This can be done by setting run_type to optimize

    in experimnnt.fit method.

All the classes inherit from Experiments class.

Machine learning algorithms for classification

Machine learning algorithms for classification

Machine learning algorithms for classification
Neural Networks for classification

Neural Networks for classification

Neural Networks for classification
Comparison of machine learning algorithms

Comparison of machine learning algorithms

Comparison of machine learning algorithms
Comparison of deep learning architectures

Comparison of deep learning architectures

Comparison of deep learning architectures
Comparison of LSTM with different transformations

Comparison of LSTM with different transformations

Comparison of LSTM with different transformations
Comparison of XGBRegressor with different transformations

Comparison of XGBRegressor with different transformations

Comparison of XGBRegressor with different transformations

Machine learning algorithms for classification

# import site
# site.addsitedir("D:\\mytools\\AI4Water")
from ai4water.datasets import MtropicsLaos
from ai4water.experiments import MLClassificationExperiments
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/experimental/enable_hist_gradient_boosting.py:17: UserWarning: Since version 1.0, it is not needed to import enable_hist_gradient_boosting anymore. HistGradientBoostingClassifier and HistGradientBoostingRegressor are now stable and can be normally imported from sklearn.ensemble.
  "Since version 1.0, "
dataset = MtropicsLaos()

#data =  dataset.make_classification(lookback_steps=1)

#print(data.shape)
0% of 0.89 MB downloaded
100% of 0.89 MB downloaded
0% of 18.0 MB downloaded
100% of 18.0 MB downloaded
0% of 11.07 MB downloaded
100% of 11.07 MB downloaded
0% of 0.88 MB downloaded
100% of 0.88 MB downloaded
0% of 7.24 MB downloaded
100% of 7.24 MB downloaded
0% of 0.04 MB downloaded
100% of 0.04 MB downloaded
0% of 0.0 MB downloaded
100% of 0.0 MB downloaded
0% of 0.01 MB downloaded
100% of 0.01 MB downloaded
0% of 0.01 MB downloaded
100% of 0.01 MB downloaded
0% of 0.04 MB downloaded
100% of 0.04 MB downloaded
0% of 0.1 MB downloaded
100% of 0.1 MB downloaded
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/rain_guage.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/rain_guage
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/hydro.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/hydro
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/suro.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/suro
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/subs1.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/subs1
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/surf_feat.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/surf_feat
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/pcp.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/pcp
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/weather_station.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/weather_station
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/soilmap.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/soilmap
unzipping /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/lu.zip to /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos/lu
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/mtropics.py:817: UserWarning: preprocessing of shapefiles can not be done because no fiona installation is found.
  warnings.warn("preprocessing of shapefiles can not be done because no fiona installation is found.")

inputs = data.columns.tolist()[0:-1] outputs = data.columns.tolist()[-1:]

exp = MLClassificationExperiments(

input_features=inputs, output_features=outputs, epochs=5, save=False

)

exp.fit(data=data,

exclude=[‘LinearDiscriminantAnalysis’])

exp.plot_cv_scores(data=data)

exp.compare_precision_recall_curves(data[inputs].values, data[outputs].values)

Total running time of the script: ( 0 minutes 56.972 seconds)

Gallery generated by Sphinx-Gallery

Neural Networks for classification

from ai4water.hyperopt import Categorical
from ai4water.datasets import MtropicsLaos
from ai4water.experiments import DLClassificationExperiments
dataset = MtropicsLaos()

#lookback = 5
#data =    dataset.make_classification(lookback_steps=lookback)

#print(data.shape)
    Not downloading the data since the directory
    /home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/data/MtropicsLaos already exists.
    Use overwrite=True to remove previously saved files and download again
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/datasets/mtropics.py:817: UserWarning: preprocessing of shapefiles can not be done because no fiona installation is found.
  warnings.warn("preprocessing of shapefiles can not be done because no fiona installation is found.")

inputs = data.columns.tolist()[0:-1] outputs = data.columns.tolist()[-1:]

exp = DLClassificationExperiments(

input_features=inputs, output_features=outputs, epochs=50, ts_args={“lookback”: lookback}, save=False

)

exp.batch_size_space = Categorical(categories=[4, 8, 12, 16, 32],

name=”batch_size”)

exp.fit(data=data,

include=[“MLP”, “CNN”, “LSTM”, “TFT”])

#exp.compare_errors('accuracy', data=data)

Total running time of the script: ( 0 minutes 0.001 seconds)

Gallery generated by Sphinx-Gallery

Comparison of machine learning algorithms

from ai4water.datasets import busan_beach
from ai4water.utils.utils import get_version_info
from ai4water.experiments import MLRegressionExperiments

for k,v in get_version_info().items():
    print(f"{k} version: {v}")
python version: 3.7.9 (default, Oct 19 2020, 15:13:17)
[GCC 7.5.0]
os version: posix
ai4water version: 1.06
lightgbm version: 3.3.5
tcn version: 3.5.0
catboost version: 1.1.1
xgboost version: 1.6.2
easy_mpl version: 0.21.2
SeqMetrics version: 1.3.4
tensorflow version: 2.7.0
keras.api._v2.keras version: 2.7.0
numpy version: 1.21.1
pandas version: 1.3.4
matplotlib version: 3.5.3
h5py version: 3.8.0
joblib version: 1.2.0
data = busan_beach()

print(data)
                       tide_cm  wat_temp_c  ...    rel_hum  tetx_coppml
index                                       ...
2018-06-19 00:00:00  36.407149   19.321232  ...  95.000000          NaN
2018-06-19 00:30:00  35.562515   19.320124  ...  95.000000          NaN
2018-06-19 01:00:00  34.808016   19.319666  ...  95.000000          NaN
2018-06-19 01:30:00  30.645216   19.320406  ...  95.006667          NaN
2018-06-19 02:00:00  26.608980   19.326729  ...  95.006667          NaN
...                        ...         ...  ...        ...          ...
2019-09-07 22:00:00  -3.989912   20.990612  ...  88.170000          NaN
2019-09-07 22:30:00  -2.807042   21.012014  ...  88.256667          NaN
2019-09-07 23:00:00  -3.471326   20.831739  ...  87.833333          NaN
2019-09-07 23:30:00   0.707771   21.006086  ...  88.370000          NaN
2019-09-08 00:00:00   1.011731   20.896149  ...  87.700000          NaN

[1446 rows x 14 columns]
comparisons = MLRegressionExperiments(
    input_features=data.columns.tolist()[0:-1],
    output_features=data.columns.tolist()[-1:],
    split_random=True,
    verbosity=0,
    save=False,
)
comparisons.fit(data=data,
                run_type="dry_run")
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
running  ARDRegression model
running  AdaBoostRegressor model
running  BaggingRegressor model
running  BayesianRidge model
running  CatBoostRegressor model
running  DecisionTreeRegressor model
running  DummyRegressor model
running  ElasticNet model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 8.332e+14, tolerance: 2.710e+11
  coef_, l1_reg, l2_reg, X, y, max_iter, tol, rng, random, positive
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  ElasticNetCV model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
running  ExtraTreeRegressor model
running  ExtraTreesRegressor model
running  GaussianProcessRegressor model
running  GradientBoostingRegressor model
running  HistGradientBoostingRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  HuberRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_huber.py:332: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
  self.n_iter_ = _check_optimize_result("lbfgs", opt_res, self.max_iter)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  KNeighborsRegressor model
running  KernelRidge model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_ridge.py:197: UserWarning: Singular matrix in solving dual problem. Using least-squares solution instead.
  "Singular matrix in solving dual problem. Using "
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  LGBMRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  Lars model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), Lars())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)


  FutureWarning,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  LarsCV model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LarsCV())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)


  FutureWarning,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
running  Lasso model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_coordinate_descent.py:648: ConvergenceWarning: Objective did not converge. You might want to increase the number of iterations, check the scale of the features or consider increasing regularisation. Duality gap: 9.650e+14, tolerance: 2.710e+10
  coef_, l1_reg, l2_reg, X, y, max_iter, tol, rng, random, positive
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  LassoCV model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
running  LassoLars model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LassoLars())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

Set parameter alpha to: original_alpha * np.sqrt(n_samples).
  FutureWarning,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  LassoLarsCV model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LassoLarsCV())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

Set parameter alpha to: original_alpha * np.sqrt(n_samples).
  FutureWarning,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
running  LassoLarsIC model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), LassoLarsIC())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)

Set parameter alpha to: original_alpha * np.sqrt(n_samples).
  FutureWarning,
running  LinearRegression model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  LinearSVR model
running  MLPRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neural_network/_multilayer_perceptron.py:696: ConvergenceWarning: Stochastic Optimizer: Maximum iterations (200) reached and the optimization hasn't converged yet.
  ConvergenceWarning,
running  NuSVR model
running  OneClassSVM model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  OrthogonalMatchingPursuit model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), OrthogonalMatchingPursuit())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)


  FutureWarning,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_omp.py:766: RuntimeWarning: Orthogonal matching pursuit ended prematurely due to linear dependence in the dictionary. The requested precision might not have been met.
  return_n_iter=True,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  OrthogonalMatchingPursuitCV model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_base.py:138: FutureWarning: The default of 'normalize' will be set to False in version 1.2 and deprecated in version 1.4.
If you wish to scale the data, use Pipeline with a StandardScaler in a preprocessing stage. To reproduce the previous behavior:

from sklearn.pipeline import make_pipeline

model = make_pipeline(StandardScaler(with_mean=False), OrthogonalMatchingPursuitCV())

If you wish to pass a sample_weight parameter, you need to pass it as a fit parameter to each step of the pipeline as follows:

kwargs = {s[0] + '__sample_weight': sample_weight for s in model.steps}
model.fit(X, y, **kwargs)


  FutureWarning,
running  PoissonRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_glm/glm.py:323: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
  self.n_iter_ = _check_optimize_result("lbfgs", opt_res)
running  RANSACRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  RadiusNeighborsRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/experiments/_main.py:2230: UserWarning: model RadiusNeighborsRegressor predicted only nans
  warnings.warn(f"model {model.model_name} predicted only nans")
running  RandomForestRegressor model
running  Ridge model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  RidgeCV model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  SGDRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  SVR model
running  TheilsenRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_theil_sen.py:131: ConvergenceWarning: Maximum number of iterations 50 reached in spatial median for TheilSen regressor.
  ConvergenceWarning,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  TweedieRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/linear_model/_glm/glm.py:323: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
    https://scikit-learn.org/stable/modules/preprocessing.html
  self.n_iter_ = _check_optimize_result("lbfgs", opt_res)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  XGBRFRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
running  XGBRegressor model
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
comparisons.compare_errors('r2', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
train test
GaussianProcessRegressor 1.000000e+00 5.335382e-01
BaggingRegressor 9.043672e-01 3.529782e-01
HuberRegressor 8.881714e-02 2.783897e-01
CatBoostRegressor 6.844128e-01 2.508949e-01
DecisionTreeRegressor 1.000000e+00 2.371542e-01
GradientBoostingRegressor 6.428487e-01 1.957935e-01
LGBMRegressor 7.140681e-01 1.892120e-01
AdaBoostRegressor 8.395908e-01 1.730707e-01
ExtraTreesRegressor 7.778136e-01 1.693949e-01
HistGradientBoostingRegressor 7.337992e-01 1.385193e-01
OrthogonalMatchingPursuitCV 2.074816e-01 1.076211e-01
LassoLarsIC 2.074816e-01 1.076211e-01
TweedieRegressor 2.396351e-01 7.945631e-02
ARDRegression 1.985954e-02 7.614211e-02
LassoLars 2.745044e-01 7.420529e-02
RandomForestRegressor 2.112886e-01 6.679858e-02
BayesianRidge 1.664916e-02 6.597272e-02
KNeighborsRegressor 3.470804e-01 5.621710e-02
XGBRegressor 1.000000e+00 5.250909e-02
ExtraTreeRegressor 5.824179e-02 4.286954e-02
OneClassSVM 5.115284e-02 3.817905e-02
Lasso 2.872418e-01 3.169814e-02
ElasticNet 2.729851e-01 3.059928e-02
Lars 2.875776e-01 3.026480e-02
OrthogonalMatchingPursuit 2.875796e-01 3.026383e-02
LinearRegression 2.875715e-01 3.026156e-02
Ridge 2.868473e-01 2.924603e-02
RidgeCV 2.849961e-01 2.390976e-02
LinearSVR 2.083020e-03 2.208388e-02
KernelRidge 3.736431e-03 1.861449e-02
NuSVR 1.582407e-03 1.717038e-02
RANSACRegressor 1.550262e-02 1.648857e-02
SVR 1.752816e-03 1.620288e-02
TheilsenRegressor 4.240463e-03 1.606258e-02
MLPRegressor 6.478158e-03 1.397929e-02
SGDRegressor 9.470476e-04 7.331519e-03
PoissonRegressor 4.260206e-01 3.996354e-03
XGBRFRegressor 8.559689e-35 1.067836e-32
DummyRegressor 6.933348e-35 6.582350e-33


best_models = comparisons.compare_errors(
    'r2',
    data=data,
    cutoff_type='greater',
    cutoff_val=0.01)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
comparisons.taylor_plot(data=data)
, Train, Test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]

<Figure size 900x700 with 2 Axes>
comparisons.taylor_plot(data=data)
, Train, Test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]

<Figure size 900x700 with 2 Axes>
comparisons.compare_edf_plots(data=data)
Empirical Distribution Function Plot
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
comparisons.compare_edf_plots(data=data, exclude=["SGDRegressor", "KernelRidge", "PoissonRegressor"])
Empirical Distribution Function Plot
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
comparisons.compare_regression_plots(data=data, figsize=(12, 14))
ml regression
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)
Model RadiusNeighborsRegressor only predicted nans
comparisons.compare_residual_plots(data=data, figsize=(12, 14))
ml regression
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/sklearn/neighbors/_regression.py:470: UserWarning: One or more samples have no neighbors within specified radius; predicting NaN.
  warnings.warn(empty_warning_msg)

<Figure size 1200x1400 with 49 Axes>

Total running time of the script: ( 2 minutes 13.912 seconds)

Gallery generated by Sphinx-Gallery

Comparison of deep learning architectures

from ai4water.datasets import busan_beach
from ai4water.utils.utils import get_version_info
from ai4water.experiments import DLRegressionExperiments
for k,v in get_version_info().items():
    print(f"{k} version: {v}")
python version: 3.7.9 (default, Oct 19 2020, 15:13:17)
[GCC 7.5.0]
os version: posix
ai4water version: 1.06
lightgbm version: 3.3.5
tcn version: 3.5.0
catboost version: 1.1.1
xgboost version: 1.6.2
easy_mpl version: 0.21.2
SeqMetrics version: 1.3.4
tensorflow version: 2.7.0
keras.api._v2.keras version: 2.7.0
numpy version: 1.21.1
pandas version: 1.3.4
matplotlib version: 3.5.3
h5py version: 3.8.0
joblib version: 1.2.0
data = busan_beach()
print(data)
                       tide_cm  wat_temp_c  ...    rel_hum  tetx_coppml
index                                       ...
2018-06-19 00:00:00  36.407149   19.321232  ...  95.000000          NaN
2018-06-19 00:30:00  35.562515   19.320124  ...  95.000000          NaN
2018-06-19 01:00:00  34.808016   19.319666  ...  95.000000          NaN
2018-06-19 01:30:00  30.645216   19.320406  ...  95.006667          NaN
2018-06-19 02:00:00  26.608980   19.326729  ...  95.006667          NaN
...                        ...         ...  ...        ...          ...
2019-09-07 22:00:00  -3.989912   20.990612  ...  88.170000          NaN
2019-09-07 22:30:00  -2.807042   21.012014  ...  88.256667          NaN
2019-09-07 23:00:00  -3.471326   20.831739  ...  87.833333          NaN
2019-09-07 23:30:00   0.707771   21.006086  ...  88.370000          NaN
2019-09-08 00:00:00   1.011731   20.896149  ...  87.700000          NaN

[1446 rows x 14 columns]
comparisons = DLRegressionExperiments(
    input_features=data.columns.tolist()[0:-1],
    output_features=data.columns.tolist()[-1:],
    split_random=True,
    val_fraction=0.0,
    epochs=200,
    ts_args={"lookback": 12},
    verbosity=0,
    save=False,
)
comparisons.fit(data=data,
                include=['MLP',
                         'LSTM',
                         'CNNLSTM',
                         'TCN',
                         "TFT",
                         "LSTMAutoEncoder",
                         ])
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
running  MLP model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
running  LSTM model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
running  CNNLSTM model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
running  TCN model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
running  TFT model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
running  LSTMAutoEncoder model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
comparisons.compare_errors('r2', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
train test
MLP 0.024583 0.126159
TCN 0.028964 0.099319
LSTM 0.019205 0.094016
LSTMAutoEncoder 0.000175 0.012198
TFT 0.010710 0.001899


best_models = comparisons.compare_errors(
    'r2',
    data=data,
    cutoff_type='greater',
    cutoff_val=0.01)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
comparisons.taylor_plot(data=data)
, Train, Test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')

<Figure size 900x700 with 2 Axes>
comparisons.compare_edf_plots(data=data)
Empirical Distribution Function Plot
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
comparisons.compare_regression_plots(data=data)
dl regression
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
comparisons.compare_residual_plots(data=data)
dl regression
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (152, 12, 13)
target shape:  (152, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (0,)
target shape:  (0,)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 12, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/_main.py:1982: UserWarning:
            argument test is deprecated and will be removed in future. Please
            use 'predict_on_test_data' method instead.
  use 'predict_on_{data}_data' method instead.""")
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')

<Figure size 640x480 with 6 Axes>
comparisons.loss_comparison()
dl regression
<AxesSubplot:>

Total running time of the script: ( 4 minutes 31.377 seconds)

Gallery generated by Sphinx-Gallery

Comparison of LSTM with different transformations

from ai4water.models import LSTM
from ai4water.utils.utils import get_version_info
from ai4water.experiments import TransformationExperiments
from ai4water.hyperopt import Categorical, Integer
from ai4water.utils.utils import dateandtime_now

from ai4water.datasets import busan_beach

for k,v in get_version_info().items():
    print(f"{k} version: {v}")
python version: 3.7.9 (default, Oct 19 2020, 15:13:17)
[GCC 7.5.0]
os version: posix
ai4water version: 1.06
lightgbm version: 3.3.5
tcn version: 3.5.0
catboost version: 1.1.1
xgboost version: 1.6.2
easy_mpl version: 0.21.2
SeqMetrics version: 1.3.4
tensorflow version: 2.7.0
keras.api._v2.keras version: 2.7.0
numpy version: 1.21.1
pandas version: 1.3.4
matplotlib version: 3.5.3
h5py version: 3.8.0
joblib version: 1.2.0
lookback = 14

data = busan_beach()
input_features = data.columns.tolist()[0:-1]
output_features = data.columns.tolist()[-1:]
class MyTransformationExperiments(TransformationExperiments):

    def update_paras(self, **kwargs):
        _layers = LSTM(units=kwargs['units'],
                       input_shape=(lookback, len(input_features)),
                       activation=kwargs['activation'])

        y_transformation = kwargs['y_transformation']
        if y_transformation == "none":
            y_transformation = None

        return {
            'model': _layers,
            'batch_size': int(kwargs['batch_size']),
            'lr': float(kwargs['lr']),
            'y_transformation': y_transformation
        }
cases = {
    'model_None': {'y_transformation': 'none'},
    'model_minmax': {'y_transformation': 'minmax'},
    'model_zscore': {'y_transformation': 'zscore'},
    'model_robust': {'y_transformation': 'robust'},
    'model_quantile': {'y_transformation': 'quantile'},
    'model_log': {'y_transformation': {'method':'log', 'treat_negatives': True, 'replace_zeros': True}},
    "model_pareto": {"y_transformation": "pareto"},
    "model_vast": {"y_transformation": "vast"},
    "model_mmad": {"y_transformation": "mmad"}
         }
search_space = [
    Integer(low=10, high=30, name='units', num_samples=10),
    Categorical(categories=['relu', 'elu', 'tanh', "linear"], name='activation'),
    Categorical(categories=[4, 8, 12, 16, 24, 32], name='batch_size'),
    Categorical(categories=[0.05, 0.02, 0.009, 0.007, 0.005,
                            0.003, 0.001, 0.0009, 0.0007, 0.0005, 0.0003,
                            0.0001, 0.00009, 0.00007, 0.00005], name='lr'),
]
x0 = [16, "relu", 32, 0.0001]

experiment = MyTransformationExperiments(
    cases=cases,
    input_features=input_features,
    output_features = output_features,
    param_space=search_space,
    x0=x0,
    verbosity=0,
    epochs=100,
    exp_name = f"ecoli_lstm_y_exp_{dateandtime_now()}",
    ts_args={"lookback": lookback},
    save=False
)
experiment.fit(data = data,  run_type='dry_run')
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
running  None model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
running  minmax model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:959: RuntimeWarning: overflow encountered in square
  s = s**2
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:959: RuntimeWarning: overflow encountered in square
  s = s**2
running  zscore model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:959: RuntimeWarning: overflow encountered in square
  s = s**2
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:959: RuntimeWarning: overflow encountered in square
  s = s**2
running  robust model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
running  quantile model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in true_divide
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
running  log model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/nanfunctions.py:1396: RuntimeWarning: All-NaN slice encountered
  overwrite_input, interpolation)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1135: RuntimeWarning: overflow encountered in square
  return sqrt(np.average((self.true - self.predicted) ** 2, axis=0, weights=weights))
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2536: RuntimeWarning: invalid value encountered in subtract
  X -= avg[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_main.py:486: RuntimeWarning: overflow encountered in square
  return float(np.average((self.true - self.predicted) ** 2, axis=0, weights=weights))
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1171: RuntimeWarning: overflow encountered in square
  numerator = (weight * (self.true - self.predicted) ** 2).sum(axis=0,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:951: RuntimeWarning: invalid value encountered in subtract
  a_zero_mean = a - mean
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/nanfunctions.py:1545: RuntimeWarning: invalid value encountered in subtract
  np.subtract(arr, avg, out=arr, casting='unsafe')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:4009: RuntimeWarning: invalid value encountered in subtract
  diff_b_a = subtract(b, a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:980: RuntimeWarning: overflow encountered in square
  _nse = 1 - sum((self.predicted - self.true) ** 2) / sum((self.true - np.mean(self.true)) ** 2)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/nanfunctions.py:1396: RuntimeWarning: All-NaN slice encountered
  overwrite_input, interpolation)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2536: RuntimeWarning: invalid value encountered in subtract
  X -= avg[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:951: RuntimeWarning: invalid value encountered in subtract
  a_zero_mean = a - mean
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/nanfunctions.py:1545: RuntimeWarning: invalid value encountered in subtract
  np.subtract(arr, avg, out=arr, casting='unsafe')
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:4009: RuntimeWarning: invalid value encountered in subtract
  diff_b_a = subtract(b, a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_main.py:486: RuntimeWarning: overflow encountered in square
  return float(np.average((self.true - self.predicted) ** 2, axis=0, weights=weights))
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1135: RuntimeWarning: overflow encountered in square
  return sqrt(np.average((self.true - self.predicted) ** 2, axis=0, weights=weights))
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1171: RuntimeWarning: overflow encountered in square
  numerator = (weight * (self.true - self.predicted) ** 2).sum(axis=0,
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:980: RuntimeWarning: overflow encountered in square
  _nse = 1 - sum((self.predicted - self.true) ** 2) / sum((self.true - np.mean(self.true)) ** 2)
running  pareto model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
running  vast model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
running  mmad model
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
experiment.compare_errors('rmse', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2536: RuntimeWarning: invalid value encountered in subtract
  X -= avg[:, None]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
train test
log inf inf
minmax 9.081883e+10 1.220093e+11
vast 4.914010e+10 6.561534e+10
zscore 9.054878e+09 1.207072e+10
robust 6.214976e+08 8.182978e+08
quantile 2.774772e+08 2.743193e+08
mmad 9.494368e+07 1.185745e+08
None 2.743344e+07 2.197229e+07
pareto 2.726834e+07 2.072512e+07


experiment.compare_errors('r2', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2536: RuntimeWarning: invalid value encountered in subtract
  X -= avg[:, None]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
train test
pareto 0.010190 0.045045
vast 0.017657 0.025451
mmad 0.018793 0.023600
robust 0.013445 0.023289
None 0.013004 0.018698
minmax 0.014014 0.015288
zscore 0.011060 0.014233


experiment.compare_errors('nrmse', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2536: RuntimeWarning: invalid value encountered in subtract
  X -= avg[:, None]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
train test
log inf inf
minmax 322.394714 1025.513973
vast 174.440798 551.510674
zscore 32.143607 101.456903
robust 2.206233 6.877965
quantile 0.985007 2.305719
mmad 0.337037 0.996644
None 0.097385 0.184682
pareto 0.096799 0.174199


experiment.taylor_plot(data=data)
, Train, Test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/SeqMetrics/_rgr.py:1148: RuntimeWarning: invalid value encountered in subtract
  zy = (self.predicted - np.mean(self.predicted)) / np.std(self.predicted, ddof=1)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/_methods.py:230: RuntimeWarning: invalid value encountered in subtract
  x = asanyarray(arr - arrmean)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2536: RuntimeWarning: invalid value encountered in subtract
  X -= avg[:, None]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2691: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[:, None]
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/function_base.py:2692: RuntimeWarning: invalid value encountered in true_divide
  c /= stddev[None, :]
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)

<Figure size 900x700 with 2 Axes>
experiment.compare_edf_plots(data=data)
Empirical Distribution Function Plot
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/core/function_base.py:134: RuntimeWarning: invalid value encountered in double_scalars
  delta = stop - start
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
experiment.compare_regression_plots(data=data)
dl transformation
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/numpy/lib/nanfunctions.py:1396: RuntimeWarning: All-NaN slice encountered
  overwrite_input, interpolation)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
experiment.compare_residual_plots(data=data)
dl transformation
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 14, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 14, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 14, 13)
target shape:  (66, 1)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/ai4water/preprocessing/transformations/_transformations.py:570: RuntimeWarning: overflow encountered in exp
  return self.inv_func(x)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)
dot plot of model could not be plotted due to ('You must install pydot (`pip install pydot`) and install graphviz (see instructions at https://graphviz.gitlab.io/download/) ', 'for plot_model/model_to_dot to work.')
assigning name Input to IteratorGetNext:0 with shape (None, 14, 13)

<Figure size 640x480 with 9 Axes>
experiment.loss_comparison()
dl transformation
<AxesSubplot:>

Total running time of the script: ( 1 minutes 23.557 seconds)

Gallery generated by Sphinx-Gallery

Comparison of XGBRegressor with different transformations

from ai4water.datasets import busan_beach
from ai4water.utils.utils import get_version_info
from ai4water.experiments import TransformationExperiments
from ai4water.hyperopt import Categorical, Integer, Real
from ai4water.utils.utils import dateandtime_now


for k,v in get_version_info().items():
    print(f"{k} version: {v}")
python version: 3.7.9 (default, Oct 19 2020, 15:13:17)
[GCC 7.5.0]
os version: posix
ai4water version: 1.06
lightgbm version: 3.3.5
tcn version: 3.5.0
catboost version: 1.1.1
xgboost version: 1.6.2
easy_mpl version: 0.21.2
SeqMetrics version: 1.3.4
tensorflow version: 2.7.0
keras.api._v2.keras version: 2.7.0
numpy version: 1.21.1
pandas version: 1.3.4
matplotlib version: 3.5.3
h5py version: 3.8.0
joblib version: 1.2.0
data = busan_beach()
input_features = data.columns.tolist()[0:-1]
output_features = data.columns.tolist()[-1:]
class MyTransformationExperiments(TransformationExperiments):

    def update_paras(self, **kwargs):

        y_transformation = kwargs.pop('y_transformation')
        if y_transformation == "none":
            y_transformation = None

        return {
            'model': {"XGBRegressor": kwargs},
            'y_transformation': y_transformation
        }
cases = {
    'model_None': {'y_transformation': 'none'},
    'model_minmax': {'y_transformation': 'minmax'},
    'model_zscore': {'y_transformation': 'zscore'},
    'model_center': {'y_transformation': 'center'},
    'model_scale': {'y_transformation': 'scale'},
    'model_robust': {'y_transformation': 'robust'},
    'model_quantile': {'y_transformation': 'quantile'},
    'model_box_cox': {'y_transformation': {'method': 'box-cox', 'treat_negatives': True, 'replace_zeros': True}},
    'model_yeo-johnson': {'y_transformation': 'yeo-johnson'},
    'model_sqrt': {'y_transformation': 'sqrt'},
    'model_log': {'y_transformation': {'method':'log', 'treat_negatives': True, 'replace_zeros': True}},
    'model_log10': {'y_transformation': {'method':'log10', 'treat_negatives': True, 'replace_zeros': True}},
    "model_pareto": {"y_transformation": "pareto"},
    "model_vast": {"y_transformation": "vast"},
    "model_mmad": {"y_transformation": "mmad"}
         }
num_samples=10
search_space = [
# maximum number of trees that can be built
Integer(low=10, high=30, name='iterations', num_samples=num_samples),
# Used for reducing the gradient step.
Real(low=0.09, high=0.3, prior='log-uniform', name='learning_rate', num_samples=num_samples),
# Coefficient at the L2 regularization term of the cost function.
Real(low=0.5, high=5.0, name='l2_leaf_reg', num_samples=num_samples),
# arger the value, the smaller the model size.
Real(low=0.1, high=10, name='model_size_reg', num_samples=num_samples),
# percentage of features to use at each split selection, when features are selected over again at random.
Real(low=0.1, high=0.5, name='rsm', num_samples=num_samples),
# number of splits for numerical features
Integer(low=32, high=50, name='border_count', num_samples=num_samples),
# The quantization mode for numerical features.  The quantization mode for numerical features.
Categorical(categories=['Median', 'Uniform', 'UniformAndQuantiles',
                        'MaxLogSum', 'MinEntropy', 'GreedyLogSum'], name='feature_border_type')
]
x0 = [10, 0.11, 1.0, 1.0, 0.2, 45, "Uniform"]
experiment = MyTransformationExperiments(
    cases=cases,
    input_features=input_features,
    output_features = output_features,
    param_space=search_space,
    x0=x0,
    verbosity=0,
    split_random=True,
    exp_name = f"xgb_y_exp_{dateandtime_now()}",
    save=False
)
experiment.fit(data = data, run_type='dry_run')
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
running  None model
[02:19:51] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  minmax model
[02:19:54] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  zscore model
[02:19:56] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  center model
[02:19:59] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  scale model
[02:20:01] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  robust model
[02:20:04] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  quantile model
[02:20:06] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


running  box_cox model
[02:20:09] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


running  yeo-johnson model
[02:20:12] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


running  sqrt model
[02:20:14] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


running  log model
[02:20:17] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


running  log10 model
[02:20:19] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


running  pareto model
[02:20:22] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  vast model
[02:20:25] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
running  mmad model
[02:20:27] WARNING: ../src/learner.cc:627:
Parameters: { "border_count", "feature_border_type", "iterations", "l2_leaf_reg", "model_size_reg", "rsm" } might not be used.

  This could be a false alarm, with some parameters getting used by language bindings but
  then being mistakenly passed down to XGBoost core, or some parameter actually being used
  but getting flagged wrongly here. Please open an issue if you find any such cases.


/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
/home/docs/checkouts/readthedocs.org/user_builds/ai4water-experiments/envs/latest/lib/python3.7/site-packages/scipy/stats/stats.py:283: RuntimeWarning: invalid value encountered in log
  log_a = np.log(a)
experiment.compare_errors('rmse', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
train test
zscore 76989.844136 1.829495e+07
vast 67745.092116 1.813990e+07
mmad 63637.688822 1.811634e+07
scale 52865.432007 1.804655e+07
robust 47502.997190 1.803859e+07
center 55266.694605 1.802654e+07
pareto 59914.405664 1.802373e+07
log 270181.799448 1.794930e+07
sqrt 58261.276136 1.792989e+07
minmax 57963.528260 1.784150e+07
log10 270496.782920 1.766912e+07
box_cox 79374.647787 1.765535e+07
yeo-johnson 74527.688244 1.765232e+07
None 62660.309653 1.750955e+07
quantile 391137.069891 9.166060e+06


experiment.compare_errors('r2', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
train test
quantile 0.997146 0.538682
box_cox 0.999939 0.292986
yeo-johnson 0.999916 0.291664
log10 0.999094 0.255802
log 0.998880 0.218938
None 0.999877 0.151187
sqrt 0.999942 0.076603
minmax 0.999893 0.068524
pareto 0.999892 0.054656
center 0.999911 0.054537
robust 0.999934 0.052759
scale 0.999918 0.052052
mmad 0.999875 0.047492
vast 0.999856 0.042825
zscore 0.999805 0.030284


experiment.compare_errors('r2_score', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
train test
quantile 0.993170 0.064507
None 0.999825 0.064368
yeo-johnson 0.999752 0.049048
box_cox 0.999719 0.048722
log10 0.996734 0.047237
minmax 0.999850 0.028556
sqrt 0.999848 0.018906
log 0.996741 0.016781
pareto 0.999840 0.008610
center 0.999864 0.008301
robust 0.999899 0.006975
scale 0.999875 0.006098
mmad 0.999819 -0.001604
vast 0.999795 -0.004210
zscore 0.999735 -0.021450


experiment.compare_errors('nrmse', data=data)
Train, test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
train test
quantile 0.010852 0.254300
zscore 0.002136 0.161920
vast 0.001879 0.160548
mmad 0.001766 0.160340
scale 0.001467 0.159722
robust 0.001318 0.159651
center 0.001533 0.159545
pareto 0.001662 0.159520
log 0.007496 0.158861
sqrt 0.001616 0.158689
minmax 0.001608 0.157907
log10 0.007505 0.156381
box_cox 0.002202 0.156260
yeo-johnson 0.002068 0.156233
None 0.001738 0.154969


experiment.taylor_plot(data=data)
, Train, Test
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

<Figure size 900x700 with 2 Axes>
experiment.compare_edf_plots(data=data)
Empirical Distribution Function Plot
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
experiment.compare_regression_plots(data=data)
ml transformation
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)
experiment.compare_residual_plots(data=data)
ml transformation
********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

********** Removing Examples with nan in labels  **********

***** Training *****
input_x shape:  (121, 13)
target shape:  (121, 1)

********** Removing Examples with nan in labels  **********

***** Validation *****
input_x shape:  (31, 13)
target shape:  (31, 1)

********** Removing Examples with nan in labels  **********

***** Test *****
input_x shape:  (66, 13)
target shape:  (66, 1)

<Figure size 640x480 with 16 Axes>

Total running time of the script: ( 0 minutes 52.032 seconds)

Gallery generated by Sphinx-Gallery

Gallery generated by Sphinx-Gallery

Indices and tables