Export function working? #81
Comments
Btw, I have also tested the exported model in Python (what I got from export_python_string() method) and it's giving identical results as my Javascript code of the same exported model. So the problem is not about a typo. |
@mikkookkim, thanks for reporting. Perhaps you have found a bug in the export code. It is relatively new and has probably not had many users yet. Would it be possible for you to post a minimal example of some Python code that reproduces the problem? If there is a bug in py-earth, your example should let me find it and fix it. If the problem is with how you're using py-earth, I should be able to point out how to fix it and perhaps make some API or documentation change on my end to prevent it from happening to others in the future. Tagging @ColCarroll, who wrote and is more expert on the export code than I am. |
Hi @jcrudy and many thanks for your quick reply! I'll send you some example code and data which hopefully helps to resolve I wasn't able to upload at least the .csv files on to github so I'll try Description of the files: dependent.csv - known real dependent variable values corresponding each row test3c_test_py - my implementation of your py-earth model being fitted for Earth_native_output.txt - output of the test3c_test.py script . The testModel2_test.py - script using the exported model string using the testModel_output.csv - output of the testModel2_test.py script. If you Again, i'll be happy to share these files privately with you to some email Thanks for any help you have time for with this issue. It would be really Br, Mikko On Mon, Jul 27, 2015 at 9:10 PM, Jason Rudy notifications@github.com
[[ 1188.3666795 145. 30. 3401.942775 ] Forward Passiter parent var knot mse terms gcv rsq grsq0 - - - 0.019449 1 0.019 0.000 0.000 7 5 1 289 0.000046 14 0.000 0.998 0.997Stopping Condition 2: Improvement below threshold Pruning Passiter bf terms mse gcv rsq grsq0 - 14 0.00 0.000 0.998 0.997 13 2 1 0.02 0.019 0.000 0.000Selected iteration: 0 Earth ModelBasis Function Pruned Coefficient(Intercept) No 0.300001 C(x1|s=-1,175,205,220)*x3 No -4.36405e-07MSE: 0.0000, GCV: 0.0000, RSQ: 0.9983, GRSQ: 0.9982 [ 0.954057 0.80601152 0.70185754 ..., 0.39531322 0.37132581 independent variables, dependent variable, predicted dependent variable value, absolute error, error percentage |
Hi @jcrudy and many thanks for your quick reply! I'll send you some example code and data which hopefully helps to resolve this issue. It would be truly great to get the export functionality working. For my project, it would be essential to get it working natively in javascript and possibly also in other languages later. Converting the model to those languages is easy as long as it's working as well as the model in your code itself after being fitted. |
yeah looks like the file attachments didn't get imported as attachments and just one of them seems to have been printed out. |
@mikkookkim, you can find my email address on my github profile I think: https://github.com/jcrudy. (I don't want to post it here in case I change it or want to take it down later for some reason). You can email me the files and I'll check it out. In general, I think there are some sites (dropbox maybe?) where you can make your data publicly available and then link from the github issue. For code and smallish data files, you can always make a gist on github and then post a link here. |
This was a bug in the @mikkookkim, thank you very much for bringing this to my attention. |
Hi,
I'm very interested in this Earth algorithm and the PY-Earth implementation. I'm working in a project where I would like to utilize something like the Earth algorithm to predict a result value based on four independent variables.
I've been testing PY-earth and I got it working really well for my test dataset. Mostly the predicted results are within 2% of the real results when testing with that known dataset and the corresponding Dependent variable values. th
I just have a problem that I'd like to use this in NodeJS. There are ways to run Python code from Javascript but in my project we would be doing lots of calculations and I think it would be really unefficient to always call Python for each individual calculation. It would also by default involve always the Earth model education steps which would again be unefficient. -
I've been playing with the included Export functionality to export the model that has been fitted with my dataset. I wrote the exported function to javascript but somehow that is not giving nearly as accurate results as Py-Earth does eventhough I guess the exported function should be the same model as what Py-Earth is using when I'm getting the accurate results.
Is there some fundamental problem when trying to use the exported function separately without the dynamic model creation and fitting? I've been checking for typos but there doesn't seem to be any..
I used the export_python_string() function to produce the exported model and then I rewrote that to JS.
Appreciating a lot for any comments.
Br,
Mikko
The text was updated successfully, but these errors were encountered: