mljs / ml

Machine learning tools in JavaScript
MIT License
2.63k stars 210 forks source link

how to integrate in browser #88

Closed Opadera closed 7 years ago

Opadera commented 7 years ago

Hello,

Can you please post an example how to integrate ml.js with requireJS for use in a browser?

I'm trying to use ML.savitzkyGolay. I dont't get how to integrate the library.

It will be available as the global ML variable. The package is in UMD format and can be "required" within webpack or requireJS.

I don't get a variable ML if I use <script src="https://www.lactame.com/lib/ml/2.2.0/ml.min.js"></script>

I can get functions like ML.AU.SNV and ML.propertyIsEnumerable with <script src="./src/ml.min.js" charset="utf-8"></script>

or

<script src="https://www.lactame.com/lib/ml/2.2.0/ml.min.js"></script>
...
requirejs(["ML"])

but none of the function mentioned on the GitHub site are available.

I would be very thankful if you can point me in the right direction.

stropitek commented 7 years ago

Hello

I don't get a variable ML if I use

This should define window.ML

but none of the function mentioned on the GitHub site are available

The API described in the readme has had significant changes compared to the last release. Please have a look at https://github.com/mljs/ml/tree/v2.2.0

Opadera commented 7 years ago

ok, just different names then... if you point to 2.2.0 in the introduction you should match the "List of inlcuded libraries" to the given structure.

thanks!

stropitek commented 7 years ago

True, it's a bit confusing :smile: