-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porting to JS #1
Comments
I added the javascript_port branch... Still some issues with passing arrays of data between the different functions... Also the result is not the same as the ruby version... need to check where things are getting changed it probably has to do with the array slicing. |
Last commit on javascript_port branch now is returning a result, although its different from the ruby version... will now check where it is breaking and fix it. |
Thats great, it doesn't look like you pushed anything to your JS branch yet, once that's there I'll setup a NS branch to pull your branch in as a dependency, then you'll be able to make improvements that will get picked up with new deploys. |
@jasoncalabrese, I just updated the javascript_port branch... index.html is where the JS is... If you run index.html on your browser and test with the same set of numbers as indicated on the Readme it should give you the same/very similar output... I think there is an issue with how javascript rounds the numbers vs ruby but the output is very very similar. Please test and let me know if it works so I can merge it to master. |
Oh, I didn't realize it was in the html, I was thinking it would be a node module that I could pull in, but it's easy to copy, so I'll give that a try. |
🙈 Let me extract into an independent js file |
@jasoncalabrese I just added simpancreas_predictor.js file... The main function which gives you the ability to predict one number or a series of numbers is: I added it the ability to receive 'dates' ( which are optional... if none are passed, the function will autogenerate 5 minute separated dates ) If you want to know the format for dates, use the following function: |
Great, thanks |
I played with the html test page a little, I was expecting the results to be an array of points going into the future, but only 1 is returned
I saw with there was a check to only return multiple predictions if there are more than 9 points, but even with extra points I get nulls.
|
There are two ways to get predictions for the index.html demo file... If you want to predict only 1 point in time, you send a set of 5 points and get returned one point in time like the first example you point out. If you want to send a lot of data points and then see how the prediction looks for that set of data points, you send lots of data points. The returned array starts with nil points so you can compare them side to side. The first predicted point needs 5 data points ( that is why you have 4 null points ) then the prediction will be 20 min ahead ( hence the other 4 null points ) and afterwards you start getting the predictions for the rest of the data points. If you always want to get 1 prediction point, use: Please let me know if it is confusing so I can try to explain it better... |
Will create a new branch for JS version of the predictor...
The text was updated successfully, but these errors were encountered: