yinlou / mltk

Machine Learning Tool Kit
BSD 3-Clause "New" or "Revised" License
136 stars 74 forks source link

GAM plots with nominal interaction terms #7

Open sds-dubois opened 8 years ago

sds-dubois commented 8 years ago

It seems to me that there is a bug in Visualizer when one of the interaction terms is not of type BinnedAttribute, because at line 251 there is a cast Bins bins1 = ((BinnedAttribute) f1).getBins(); without a previous type test. This is weird because some tests are made before to handle NominalAttributes, but the end of the code seems to run only on BinnedAttributes (in particular it need boundaries which are only defined for bins..).

yinlou commented 8 years ago

The code was initially designed to support both BinnedAttribute and NominalAttribute, but at some point I was focusing on BinnedAttribute. I will fix that in the next iteration. Thanks for point that out!

sds-dubois commented 8 years ago

I tried to fix it, and was able to do it when both are discrete but couldn't do what I wanted with gnuplot when one is discrete and one is continuous. So I actually decided to use ggplot in R, and to call my R scripts from Java. If you're interested you can see what I did on my fork (check the branch selectFeatures).

Here is an example of the new plots: new_plots2