Have a tabular data set and have done some graphical exploration with Orange 3. Attempted NN regression with Keras/TensorFlow 2.0 beta on Python 3.6.7.

The problem is that TF 2.0 is not "learning" (R2 has been less than zero). Tried varying number/size of layers, activation fns, etc. The X-Y plot of predictions vs. results is just a random blob of dots. In some cases the model output is more-or-less a fixed number, and the "learning" is only minimizing R2 of a horizontal line.

Brought the same dataset into scikit-learn 0.21.2 (SKL) and the SKL MLPRegressor does show some correlation in an X-Y plot. In fact a simple Linear SVM regression shows the best R2 value (so far).

The supporting files and test data are here: https://github.com/EcoFactor/Public/tree/master/ml-examples

  • test.csv - test data, contains 2 target columns target_ba and target_a. The examples here are all regression on target_ba. There is some correlation of target_ba and target_a, so target_a must be removed as a feature.
  • test-ba-tf.ipynb - TF notebook, regression on column target_ba
  • test-ba-skl-nn.ipynb - SKL NN notebook.
  • test-ba-skl-lsvr.ipynb - SKL Linear SVM notebook.

The test dataset is based on transforming actual field data, so it would not be surprising if the best possible R2 is only about 0.7. But would like to understand what is wrong with my TF usage -- or maybe a pointer on how to debug what's wrong. The SKL examples are obviously finding something and TF is not.

My intent is that after getting TF to work on this example, will try different NN architectures and possibly bring in additional field data to improve correlation.

TF X-Y plot of predicted vs. actual TF X-Y plot of predicted vs. actual

SKL LSVR X-Y plot of predicted vs. actual SKL LSVR X-Y plot of predicted vs. actual


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.