Re: [elm-discuss] Re: The NumPy for Elm

2017-11-03 Thread 'Rupert Smith' via Elm Discuss
On Friday, November 3, 2017 at 10:06:49 AM UTC, Francisco Ramos wrote:
>
> Sounds good. Remember, I built NumElm with Machine Learning algorithms in 
> mind. So I added mostly the functionality used in such algorithms. 
>

I suppose polynomial fitting is a kind of machine learning. I am a little 
bemused by how much ML currently seems to be focused on neural networks, I 
always thought kernel methods would overtake the neural approach. Kernel 
methods map non-linear problems back into linear ones with higher 
dimensionality, just like how this polynomial curve fitting turns a 
polynomial into a linear fitting problem with as many dimensions as the 
degree of the polynomial.

I created this gist for you. Just now, and without testing, so I'm not sure 
> if it works, but it looks like what you're looking for. Please give it a 
> try and let me know:
>
> https://gist.github.com/jscriptcoder/3be0e4186bc8098d1310e6e7fb3bf441
>

Thanks.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: The NumPy for Elm

2017-11-03 Thread Francisco Ramos
Sounds good. Remember, I built NumElm with Machine Learning algorithms in
mind. So I added mostly the functionality used in such algorithms.


I created this gist for you. Just now, and without testing, so I'm not sure
if it works, but it looks like what you're looking for. Please give it a
try and let me know:

https://gist.github.com/jscriptcoder/3be0e4186bc8098d1310e6e7fb3bf441

Fran


On Fri, Nov 3, 2017, 10:39 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Thursday, November 2, 2017 at 5:28:15 PM UTC, Francisco Ramos wrote:
>>
>> Hey Rupert,
>>
>> Let me have a look when I have a little bit of time and I'll get back to
>> you.
>>
>> Fran
>>
>
> I will also have a go at implementing the polynomial stuff in my own
> Plynomials.elm built on top of what NumElm already has. If I make some good
> progress with it, then we can look at pulling it into NumElm.
>
> Rupert
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: The NumPy for Elm

2017-11-03 Thread 'Rupert Smith' via Elm Discuss
On Thursday, November 2, 2017 at 5:28:15 PM UTC, Francisco Ramos wrote:
>
> Hey Rupert, 
>
> Let me have a look when I have a little bit of time and I'll get back to 
> you.
>
> Fran
>

I will also have a go at implementing the polynomial stuff in my own 
Plynomials.elm built on top of what NumElm already has. If I make some good 
progress with it, then we can look at pulling it into NumElm.

Rupert 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: The NumPy for Elm

2017-11-02 Thread Francisco Ramos
That's great. Thanks for the links. I read about PyData. Sounds
promising... I'm algo checking out ML packages in Haskell. I'd like to see
other more functional approaches.

Fran

On Thu, Nov 2, 2017, 19:31 Matthieu Pizenberg 
wrote:

> Hi Francisco, that's awesome what you aim for. I'm also looking forward
> for more scientific programming stuff in elm.
> Inspiration from numpy is a great choice considering almost all learning
> frameworks are usable in python. As a sidenote though you might want to
> have a look at the xtensor project 
> (also inspired by numpy). I've not used it yet but I've seen their 
> introduction
> video at PyData  and the approach looks
> great! I think it could give you some ideas if you want to create a generic
> package for machine learning in elm.
>
> Cheers,
> Matthieu
>
>
> On Tuesday, October 31, 2017 at 5:32:06 AM UTC-7, Francisco Ramos wrote:
>>
>> Today I'm releasing NumElm, another small contribution to the Open
>> Source, Frontend and Elm community. NumElm is inspired by NumPy, the
>> fundamental package for scientific computing with Python. NumElm is the
>> first step in this ambitious idea of mine of building a Machine Learning
>> package for Elm. Still a long way to go, but I'm full of enthusiasm. I'm
>> convinced about the potential of both worlds together, Elm language and
>> Machine Learning.
>>
>> https://github.com/jscriptcoder/numelm
>>
>> Please, any feedback would be highly appreciated.
>>
>> Fran
>>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elm-discuss] Re: The NumPy for Elm

2017-11-02 Thread Francisco Ramos
Hey Rupert,

Let me have a look when I have a little bit of time and I'll get back to
you.

Fran

On Thu, Nov 2, 2017, 15:41 'Rupert Smith' via Elm Discuss <
elm-discuss@googlegroups.com> wrote:

> On Wednesday, November 1, 2017 at 8:38:48 PM UTC, Rupert Smith wrote:
>>
>> How would I write a curve fitting alrogithm with this? So I have a 3rd
>> order polynomial:
>>
>> y = a + b.x + c.x^2 + d.x^3
>>
>> and some linear algebra on 100 data points will yield values for a, b, c
>> and d. I'll post up the python code tomorrow, it seems to use an in-built
>> fit_curve() function.
>>
>
> Here is the NumPy code that I would like to convert to NumElm:
>
> import time
> import numpy as nm
>
> def get_curve(measurements, timestamps):
>   y = measurements
>   x = timestamps
>   z = nm.polyfit(x, y, 3)
>   f = nm.poly1d(z)
>
>
>   return f
>
>
> but polyfit and poly1d have not been ported to NumElm. I will take a look
> into how to port them.
>
> Rupert
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: The NumPy for Elm

2017-11-02 Thread 'Rupert Smith' via Elm Discuss
On Wednesday, November 1, 2017 at 8:38:48 PM UTC, Rupert Smith wrote:
>
> How would I write a curve fitting alrogithm with this? So I have a 3rd 
> order polynomial:
>
> y = a + b.x + c.x^2 + d.x^3
>
> and some linear algebra on 100 data points will yield values for a, b, c 
> and d. I'll post up the python code tomorrow, it seems to use an in-built 
> fit_curve() function.
>

Here is the NumPy code that I would like to convert to NumElm: 

import time
import numpy as nm

def get_curve(measurements, timestamps):
  y = measurements
  x = timestamps
  z = nm.polyfit(x, y, 3)
  f = nm.poly1d(z)


  return f


but polyfit and poly1d have not been ported to NumElm. I will take a look 
into how to port them.

Rupert

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elm-discuss] Re: The NumPy for Elm

2017-11-01 Thread 'Rupert Smith' via Elm Discuss
On Tuesday, October 31, 2017 at 12:32:06 PM UTC, Francisco Ramos wrote:
>
> https://github.com/jscriptcoder/numelm
>
> Please, any feedback would be highly appreciated.
>

So, I have a project at work where we are using NumPy running on AWS. I 
have been looking into how to write AWS Lambda functions using Elm, and 
found this excellent project:

http://package.elm-lang.org/packages/ktonon/elm-serverless/latest
https://github.com/ktonon/elm-serverless

One cool thing about how it is implemented, is that it uses a wrapper 
around the Elm program to establish a new type of 'Program'. As such it 
doesn't have ports or hacked any kernel code - yet it is definitely 
stretching Elm well outside of it comfort zone as a client side only 
language. I think that is pretty neat, because my instincts would have been 
either to use ports or do some kernel hacking and ended up with code that I 
could not then share on package.elm-lang.org. I somehow automatically 
assume that doing anything with elm that is not TEA is going to involve 
native code in such a way that a non-shareable package is created and the 
back-door that is elm-github-install will be used.

My work project involves running an algorithm in NumPy against 10s or 100s 
of days of data points and doing some curve fitting to then make an 
estimate of when some equipment is going to exceeed its specified operating 
parameters (I'm being vague because I signed an NDA).

So once I get my Elm Lambda functions experiment working nicely, I can try 
out converting the NumPy algorithms into NumElm. All the NumPy algorithms I 
have are quite short, its fairly simple stuff we are doing. Even if NumElm 
turns out a bit slow, its only a few hundred data points at most so I think 
it will be ok. I also think fetching the data from the database (Athena) 
will tend to dominate rather than the CPU work.

How would I write a curve fitting alrogithm with this? So I have a 3rd 
order polynomial:

y = a + b.x + c.x^2 + d.x^3

and some linear algebra on 100 data points will yield values for a, b, c 
and d. I'll post up the python code tomorrow, it seems to use an in-built 
fit_curve() function.

Rupert

 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.