Re: community interest in machine learning (?)

953 views
Skip to first unread message

Alex Ott

unread,
Jul 16, 2012, 9:16:43 AM7/16/12
to clo...@googlegroups.com
Hi Joshua

I know several people who're interested in this. I slowly working on
translation of Mahout in Action examples to Clojure
(https://github.com/alexott/mia-clj), and hope, that using these
examples, as a base, we can build "clojurish" bindings for Mahout.

I think, that some basic building blocks for ML could be also found in
Incanter project...

On Sun, Jul 15, 2012 at 7:10 PM, Joshua Bowles <bowle...@gmail.com> wrote:
> New to Clojure (but not Lisp).
>
> Does anyone have a good sense of the interest in machine learning in Clojure
> community?
> I've seen in the last few threads some interesting posts and libraries
> related to machine learning, and there is plenty of stuff one can get from
> Java (mahout, weka, clj-ml
> [http://antoniogarrote.github.com/clj-ml/index.html]), but I'm curious to
> know if anyone here has a sense of the overall community interest.
>
> It's nice to see interesting libraries that support needed tasks for machine
> learning (I'm all for links to libraries), but what I'm really trying to get
> is a sense of the overall interest the community has in machine learning.
> For example, Python community overall has a lot of interest in scientific
> computing and machine learning. Compare this to Ruby... not that you
> couldn't provide good libraries in Ruby (for example the SciRuby project),
> but the Ruby community overall does not seem to have much interest in these
> kinds of academic pursuits.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



--
With best wishes, Alex Ott
http://alexott.net/
Tiwtter: alexott_en (English), alexott (Russian)
Skype: alex.ott

Joshua Bowles

unread,
Jul 16, 2012, 10:24:36 AM7/16/12
to clo...@googlegroups.com
Incanter does look great; look forward to getting into it; I'll check out your mahout examples too... I'm about ready to tear into that book.

So much research has been done in Artificial Intelligence with LISP. With the applied history of LISP it just seems like a perfect fit for Clojure to take the lead in many AI sub-fields. I know also that a few people taking Andrew Ng's (online) Machine Learning Class did it in Clojure. 

Alex Ott

unread,
Jul 16, 2012, 12:25:06 PM7/16/12
to clo...@googlegroups.com
If you'll start to read this book, and plan to do examples in Clojure,
then I can give you access to my repository - to benefit from
collaborative work ;-)

I also thought about using Weka, but the "Data Mining: Practical
Machine Learning Tools and Techniques, 3ed" is still waiting in
reading queue...

Joshua Bowles

unread,
Jul 16, 2012, 12:32:05 PM7/16/12
to clo...@googlegroups.com
Nice. I'm still few weeks from diving in... still groking the Clojure API... but when I'm ready I'm up for a collaborative effort!

dmirylenka

unread,
Jul 16, 2012, 7:20:13 PM7/16/12
to clo...@googlegroups.com
Not sure about the community, but I personally would be very interested in having a machine learning library or environment in Clojure.

I'm playing with classification and clustering of academic papers, and use clojure for the whole research cycle - crawling and parsing the data from the web, text processing (through weka or mallet), classification (through svm-clj), and, of course, setting up the experiments, and doing input-output between other tools. 

I was also thinking it would be nice to have Incanter extended with machine learning algorithms.
So far it looks like its focus has been statistics rather then machine learning.

Jeff Heon

unread,
Jul 16, 2012, 9:53:26 PM7/16/12
to clo...@googlegroups.com
I could not comment on the community as a whole, but certainly a part of it has interest in it.

Here is a presentation about using ML in Clojure for genome research:
Hacking the Human Genome Using Clojure and Similarity Search
http://bit.ly/yKFnPA

Also, an interview with the speaker:
http://bit.ly/Ai6ILm

Lee Spector

unread,
Jul 17, 2012, 11:21:32 AM7/17/12
to clo...@googlegroups.com

Whether this counts as "machine learning" depends on your perspective, but my group uses clojure for research in genetic programming and related forms of evolutionary computation. See, e.g., https://github.com/lspector/Clojush/

Some of the students in my lab also work in more mainstream forms of machine learning, using Clojure, and we would certainly be interested in checking out and possibly using any other ML tools in Clojure.

FWIW I come from a Lisp/AI background and have switched to Clojure in the last couple of years... and I think it's a pretty ideal environment for the kind of AI research that I do...

-Lee
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

--
Lee Spector, Professor of Computer Science
Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspe...@hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438

Jim.foobar

unread,
Jul 17, 2012, 3:29:50 PM7/17/12
to clo...@googlegroups.com

i also have a strong interest in machine learning...to that end i've wrapped most of encog v3...you can find it on github and clojars as "clojure-encog"...sorry for the brief reply im on vacation and just found some internet ...

Sent from my mobile...



Lee Spector <lspe...@hampshire.edu> wrote:


Joshua Bowles

unread,
Jul 17, 2012, 3:51:01 PM7/17/12
to clo...@googlegroups.com
Thanks to all the replies. I'm starting to think that the future of Clojure in the Artificial Intelligence domain (including machine learning) is extr

Joshua Bowles

unread,
Jul 17, 2012, 3:51:25 PM7/17/12
to clo...@googlegroups.com
Thanks to all the replies. I'm starting to think that the future of Clojure in the Artificial Intelligence domain (including machine learning) is extremely promising.

myriam abramson

unread,
Jul 17, 2012, 9:58:07 PM7/17/12
to clo...@googlegroups.com

Yes, I am interested too. All I have done is an implementation of HMM and I am looking to use clj-ml to interface with Weka.

Maik Schünemann

unread,
Jul 18, 2012, 6:37:27 AM7/18/12
to clo...@googlegroups.com
I'm interested too and I am glad to here that the community shares the interest!
Clojure seems like an ideal AI and ML language for me because of its lisp heritage and because it is running on the jvm and can use all java and jvm language libraries and vice versa

On Wed, Jul 18, 2012 at 3:58 AM, myriam abramson <labw...@gmail.com> wrote:

Yes, I am interested too. All I have done is an implementation of HMM and I am looking to use clj-ml to interface with Weka.

--

Joshua Bowles

unread,
Jul 18, 2012, 8:23:50 AM7/18/12
to clo...@googlegroups.com
I've written to Coursera to request a course in "Artificial Intelligence with Clojure"; they offer about 8 courses related to Artificial Intelligence. One of the latest course offerings is "Functional Programming Principles in Scala" taught by the language's creator Martin Odersky.

If you would like to send Coursera a request for a Clojure class: http://help.coursera.org/customer/portal/emails/new

Joshua Bowles

unread,
Jul 20, 2012, 12:34:03 PM7/20/12
to clo...@googlegroups.com
Check this out for weka: https://github.com/antoniogarrote/clj-ml

On Tue, Jul 17, 2012 at 8:12 PM, Seth Chandler <chandl...@gmail.com> wrote:
I'm extremely interested.  I'm new to Clojure, coming mostly from a Mathematica background, but I just finished a major project linking Mathematica to Weka and am interested in doing something similar with Clojure.  Weka, by the way, is 99% terrific, and so before people go completely reinvent the wheel, it might be worthwhile thinking about a Clojure-Weka interface of sorts.  


On Sunday, July 15, 2012 11:10:22 AM UTC-6, Joshua Bowles wrote:
New to Clojure (but not Lisp).

Does anyone have a good sense of the interest in machine learning in Clojure community?
I've seen in the last few threads some interesting posts and libraries related to machine learning, and there is plenty of stuff one can get from Java (mahout, weka, clj-ml [http://antoniogarrote.github.com/clj-ml/index.html]), but I'm curious to know if anyone here has a sense of the overall community interest. 

It's nice to see interesting libraries that support needed tasks for machine learning (I'm all for links to libraries), but what I'm really trying to get is a sense of the overall interest the community has in machine learning. For example, Python community overall has a lot of interest in scientific computing and machine learning. Compare this to Ruby... not that you couldn't provide good libraries in Ruby (for example the SciRuby project), but the Ruby community overall does not seem to have much interest in these kinds of academic pursuits.

--

Ben Mabey

unread,
Jul 20, 2012, 1:35:44 PM7/20/12
to clo...@googlegroups.com
On 7/20/12 10:34 AM, Joshua Bowles wrote:
> Check this out for weka: https://github.com/antoniogarrote/clj-ml

FYI, that fork isn't maintained anymore. I've updated it quite a bit
and fixed a lot of reflection issues that were making it unusable in
production:

https://github.com/bmabey/clj-ml

If I had enough time I would probably rewrite the library since there
are a number of things that bug me about the API. Ideally, we could
have the majority of the wrappers generated from java-docs since
manually wrapping every single option is quite tedious. It gets the job
done though and we have been using it in production for two years now.
In addition to using weka libraries we have wrapped encog and have
written some of our own algorithms including an ensemble algorithm
(based mostly on Rich Caruana's work[1]) which composes all these
algorithms.

As far as general ML in clojure goes... We've liked using clojure for
our ML work but it does suffer from the split language problem. Meaning,
code you write for performant ML algorithms is not the same type of code
you regularly write in Clojure (same as writing numpy is different than
regular python). The trick is to wrap all the interop in nice clojure
abstractions so you don't have to think about it all the time. You have
to realize that using lazy-seqs and clojure collections in general are
non-starters since they don't yet support primitives yet and will never
be as optimized as existing Fortran (read BLAS/LAPACK) and Java code.
Here is a SO answer of mine explaining the same thing in more detail:
http://stackoverflow.com/a/8902524/233964

I started releasing some nice (IMO) wrappers for parallel colt that
allow you to get a little closer to the library than Incanter allows you
to. I never got too far but what I did release is useful (I use them at
work) and could be a good starting point for someone else:
https://github.com/bmabey/claw/blob/master/src/claw/core.clj

(Note, the reason why I needed this was because the abstractions in
Incanter, while beautiful, were too costly for my needs.)

Lastly, at ClojureWest Bradford Cross mentioned in his keynote[2] that
they were eventually going to release some of their libraries that they
use at Prismatic. Although he didn't say this exactly it sounded liked
they had written some convex-optimization algorithms using pure java
arrays with their wrapper library called Flop. It doesn't look like
they have released anything yet (https://github.com/prismatic).

-Ben



1. http://www.cs.cornell.edu/~caruana/
2. http://www.infoq.com/presentations/Why-Prismatic-Goes-Faster-With-Clojure

cameron

unread,
Jul 21, 2012, 7:18:19 PM7/21/12
to clo...@googlegroups.com

I wrote a clojure wrapper for GEVA ( a gramatical evolutional library, see http://ncra.ucd.ie/Site/GEVA.html) that I can put on github if theres any interest. I'm not as active in this area as I once was but I'm definitely still interested. 

Lee Spector

unread,
Jul 21, 2012, 7:41:14 PM7/21/12
to clo...@googlegroups.com

I'd like to see this, as might others in the evolutionary computing community. I just gave some presentations at GECCO at which I mentioned that my current work is implemented in Clojure, and a couple of people told me that they were interested in working in Clojure too.

-Lee

Joshua Bowles

unread,
Jul 22, 2012, 12:44:08 PM7/22/12
to clo...@googlegroups.com
Thanks for the references. 

You have to realize that using lazy-seqs and clojure collections in general are 
non-starters since they don't yet support primitives yet and will never 
be as optimized as existing Fortran (read BLAS/LAPACK) and Java code.
 

Good point. I wasn't even thinking abou this kind of stuff yet... thanks. No matter the language, it seems like it always ends up coming back to BLAS/LAPLACK... ahhh Fortran.

cameron

unread,
Jul 25, 2012, 6:04:59 PM7/25/12
to clo...@googlegroups.com
I've posted the code for the clojure enhanced GEVA library,
there's a getting started guide available at http://cdorrat.github.com/geva-clj/
and the source is available  at http://github.com/cdorrat/geva-clj

It's currently based on GEVA 1.2 if there's enough interest I'll look at merging the changes from 2.0 release.

Cheers,
   Cameron.

Lee Spector

unread,
Jul 26, 2012, 9:42:07 AM7/26/12
to clo...@googlegroups.com

Cameron,

I'm eager to check this out.

There's a missing quote mark in the dependency line in the getting started guide, but after fixing it I still get:

Downloading: org/clojars/cdorrat/geva-clj/1.2-SNAPSHOT/geva-clj-1.2-SNAPSHOT.pom from repository clojars at http://clojars.org/repo/
Unable to locate resource in repository
[INFO] Unable to find resource 'org.clojars.cdorrat:geva-clj:pom:1.2-SNAPSHOT' in repository clojars (http://clojars.org/repo/)
An error has occurred while processing the Maven artifact tasks.

This is in a fresh Clojure 1.3 project to which I've just added that one dependency.

Am I missing something obvious?

Thanks,

-Lee

cameron

unread,
Jul 26, 2012, 6:52:59 PM7/26/12
to clo...@googlegroups.com
Hi Lee,
   apologies for the missing dependencies, it's been a while since I worked on the project and I had local copies of jscheme in .m2. The documentation has been fixed and I've updated the dependencies.

I've run the samples a built a fresh checkout  on a clean machine so I think you should be ok now though I did have to delete ~/.m2 in one case.

Let me know if you have any problems.

Cheers,
   Cameron.

Timothy Washington

unread,
Jul 27, 2012, 3:03:23 PM7/27/12
to clo...@googlegroups.com
I'm working on a Neural Network application to tech myself machine learning and AI. 
There's nothing there right now. But I'm keenly interested in the field, and getting a working project, predicting financial time series. I'm keen to check out clojure-encog, and any other AI library. I just want to make sure I understand the mechanics of the algorithms that are being used. 


Very exciting 

Tim Washington 

Dimitrios Jim Piliouras

unread,
Jul 28, 2012, 8:51:41 AM7/28/12
to clo...@googlegroups.com
If you're doing anything related with neural nets I think clojure-encog is indeed the place to start... I've wrapped most of the original java encog v3 so far and I am actively using it for my own projects...I'd be very happy to hear your feedback if you decide to use it after all...The truth is I've not provided a wiki  but I have provided an examples.clj where I've ported some of the most famous encog examples using my wrapper...hope you find it useful! any help you need along the way don't hesitate to ask! predicting financial series has been done in the past by heaton-research but unfortunately I've not ported that example! maybe it is time to do so as soon as I return from holidays...

take care... :)

Jim

--

Timothy Washington

unread,
Jul 28, 2012, 6:52:58 PM7/28/12
to clo...@googlegroups.com
Hey Jim, 

Encog does look very interesting. Right now, I'm trying (and failing) to implement the sigmoid function. I'm using wikipedia's reference, and trying to use Incanter's (incanter/exp) function, but Incanter's function doesn't seem to work: 

user> user> (incanter/exp -3254604.9658621363)
0.0 
user> user> (incanter/exp 3254604.9658621363)
Infinity

I took a peek at encog's java sigmoid implementation, and while my calculus is correct, they are using their own exponential function. i) Is there another Incanter function I should be using? ii) Maybe the number going into (incanter/exp) has to be within a certain range? I'm getting that 3254604.9658621363 number as a linear combination of these inputs (i took the long value of time and randomized the weights). iii) Is there a different way to sum these value? Is this where input data massaging comes in? 

  ({:key :time, :value #<DateTime 2012-05-01T20:00:00.676Z>, :weight 0.22072475374809264}
   {:key :bid, :value 1.3239, :weight 0.5831561982324751}
   {:key :ask, :value 1.32379, :weight 0.9364679759677283}
   {:key :bvolume, :value 3000000.0, :weight 0.5956072849191396}
   {:key :avolume, :value 2250000.0, :weight 0.07837823837657176}),


There's a few other issues I'm still trying to understand. I outlined them in this quant.stackexchange post. But primarily: 
  • Algorithmically, I don't understand how to achieve both bid and ask predictions with each tick? the i) linear combiner and ii) activation functions, coupled with the bias, act to produce 1 value
  • In Back Propagation, is it just the weights that are adjusted, or the biases as well? 

There are other things like how to decide the number of neurons in the hidden layer. But once I get a very simplistic code example working, I'll feel more confidence in understanding the mechanics of this neural network works. And I'd start using your clojure-encog library as it's probably much more complete than anything I could build. Any insights or examples you could provide would be great. 


Cheers 

Ben Mabey

unread,
Jul 28, 2012, 7:44:03 PM7/28/12
to clo...@googlegroups.com
On 7/28/12 4:52 PM, Timothy Washington wrote:
Hey Jim, 

Encog does look very interesting. Right now, I'm trying (and failing) to implement the sigmoid function. I'm using wikipedia's reference, and trying to use Incanter's (incanter/exp) function, but Incanter's function doesn't seem to work: 

user> user> (incanter/exp -3254604.9658621363)
0.0 
user> user> (incanter/exp 3254604.9658621363)
Infinity

Try this...

(use 'incanter.core)
=> (defn sigmoid [z]
              (div 1 (plus 1 (exp (minus z)))))
=> (sigmoid 0)
0.5
=> (sigmoid 7)
0.9990889488055994
=> (sigmoid 112)
1.0
=> (sigmoid -112)
2.285693676718672E-49


If you want the library to be fast you will want to be using primitives or use the underlying colt API.. for learning purposes you don't really need to worry about that though.

HTH,
Ben

Lee Spector

unread,
Jul 28, 2012, 11:26:37 PM7/28/12
to clo...@googlegroups.com

Thanks Cameron,

I've tried again and indeed it does work now. Thanks so much,

-Lee


On Jul 26, 2012, at 6:52 PM, cameron wrote:

> Hi Lee,
> apologies for the missing dependencies, it's been a while since I worked on the project and I had local copies of jscheme in .m2. The documentation has been fixed and I've updated the dependencies.
>
> I've run the samples a built a fresh checkout on a clean machine so I think you should be ok now though I did have to delete ~/.m2 in one case.
>
> Let me know if you have any problems.
>
> Cheers,
> Cameron.

Timothy Washington

unread,
Jul 29, 2012, 10:41:02 AM7/29/12
to clo...@googlegroups.com
Hey Ben, 

It's the same problem. 

user> (incanter/exp (incanter/minus 3254604.9658621363))
0.0

But it's not the functions. It's the math. Euler's number 2.71828... raised to the power of 3254604.9658621363, gives Infinity. So for my neural net's activation func, either i) I shouldn't used a sigmoid, or ii) my linear combiner needs to keep values within a certain bound. My neuron inputs are below. And it's the bid and sk volumes and the long time value that's giving me such a large number. 
  • 1.3239 (bid price) 
  • 1.32379 (ask price) 
  • 3000000.0 (bid volume) 
  • 2250000.0 (ask volume) 
  • 1335902400676 ( #<DateTime 2012-05-01T20:00:00.676Z> long value) 

I just had the idea to try a Gaussian or tanh activation function. I think this is the point where I'll give clojure-encog a whirl. I have a feeling I'll be running into a lot of these data and other algorithmic problems. And it'd be good to work with something that has already dealt with these issues. I still don't know if I need to normalize my input data, how to untangle the activation result for back propagation, etc. Any insights are welcome. 

Dimitrios Jim Piliouras

unread,
Jul 29, 2012, 11:35:46 AM7/29/12
to clo...@googlegroups.com
Hi Tim,

According to :
http://www.heatonresearch.com/content/encog-30-article-2-design-goals-overview

encog 3 should have descent support for any temporal (time-series) based prediction support in particular for financial predictions...I'm afraid however that the only example that I've ported to clojure-encog which uses temporal data is the sunspot example (SVM not NN).

Also, you shouldn't have any problems with the data (most likely you need to normalize them - I usually find  (-1 1) or (0 1) to work best.
for an example of how exactly you would do it  look for "PREDICT-SUNSPOT-SVM"  here:
https://github.com/jimpil/clojure-encog/blob/master/src/clojure_encog/examples.clj

these 2 lines do all the job with regards to your input data:
normalizedSunspots (prepare :array-range nil nil :raw-seq spots :ceiling 0.9 :floor 0.1)
train-set  ((make-data :temporal-window normalizedSunspots)  window-size 1)


As far as algorimthmic problems go encog has been around for quite a while...even though I don't necessarily agree with all the design decisions made along the way I find it is a  rather mature lib...of course it is written in Java so being large means it is a bit of a mess! also there is a lot of duplication in random places...anyways, what I'm trying to say is:

if you've got a specific example in mind, (like the financial prediction) maybe it's worth trying it out using clojure-encog or the encog-workbench (the gui) or any other already-made lib and see how it goes...writing your own will certainly teach you loads but it might take a while until you actually test what you want to test...

Normalisation, randomisation or both are almost always needed...

Hope that helps...

Jim
 


--

Timothy Washington

unread,
Aug 4, 2012, 1:52:58 PM8/4/12
to clo...@googlegroups.com
Hey Jim, 

So I started playing around with clojure-encog, and I'm pretty excited about it so far. Again, I'm trying to make a financial series predictor. And I'm trying to go through the steps of 1) nomalizing / preparing the data 2) creating a feed-forward neural network with back-prop (I'll try sigmoid & gaussian activations). Then I'll 3) train and 4) run the network. 


A) The first problem I'm having is a library one. I'm trying to normalize the data with the (prepare ...) function, but the normalization namespace isn't in [clojure-encog "0.4.0-SNAPSHOT"]. Here, we see that the nnets and training namespaces are in the snapshot jar, but not the normalization namespace. So I don't know how easy it is to update the snapshot jar. But in the meantime, I'll see if I can use the github version. 

webkell@ubuntu:~/Projects/nn$ jar tvf lib/clojure-encog-0.4.0-20120518.170223-1.jar 
    72 Fri May 18 17:58:04 PDT 2012 META-INF/MANIFEST.MF
  1961 Fri May 18 17:58:04 PDT 2012 META-INF/maven/clojure-encog/clojure-encog/pom.xml
   111 Fri May 18 17:58:04 PDT 2012 META-INF/maven/clojure-encog/clojure-encog/pom.properties
   584 Fri May 18 17:00:30 PDT 2012 project.clj
  9839 Fri May 18 17:01:38 PDT 2012 clojure_encog/nnets.clj
 11532 Fri May 18 17:57:20 PDT 2012 clojure_encog/examples.clj
 10144 Fri May 18 17:43:58 PDT 2012 clojure_encog/training.clj
  2177 Mon May 14 21:57:20 PDT 2012 java/NeuralPilot.java
  7574 Wed May 16 20:34:30 PDT 2012 java/PredictSunspotSVM.java
  2338 Mon May 14 21:56:42 PDT 2012 java/LanderSimulator.java
  1794 Fri May 18 16:02:22 PDT 2012 java/XORNEAT.java
  1672 Fri May 18 16:04:14 PDT 2012 java/XORNEAT.class
  1872 Mon May 14 14:53:26 PDT 2012 java/LanderSimulator.class
  1943 Mon May 14 14:53:26 PDT 2012 java/NeuralPilot.class
  7357 Wed May 16 20:37:20 PDT 2012 java/PredictSunspotSVM.class



B) The second problem I see is when trying to deal with the input data. The example in clojure-encog, has just an array of doubles. But my input data is slightly different in that I'm dealing with a LazySeq of arrays. Each of those arrays contain tick data, Time, Ask, Bid, AskVolume and BidVolume: 

(["01.05.2012 20:00:00.676" "1.32390" "1.32379" "3000000.00" "2250000.00"] 
 ["01.05.2012 20:00:00.888" "1.32390" "1.33238" "3000000.10" "2200000.00"] 
 ...) 


So of course a call to ((make-data ...) , fails with the error "clojure.lang.LazySeq cannot be cast to [Double..". So I need to figure out 1) a way to get each one of those input data points , into an input-layer neuron. I've started to think about that when I was dabbling with code. If you like, I can look into trying to jerry-rig these kinds of tick data mappings into ( training/make-data ). But I need a better understanding of the concept of a Temporalwindow. The other thing is 2) to figure out how to transform the time field into data the nn can use. I've been spitting the Datetime object out to longs. 


Thanks 

Tim Washington 

Jim - FooBar();

unread,
Aug 4, 2012, 2:18:59 PM8/4/12
to clo...@googlegroups.com
poooo this is very strange...i'll update clojars within the next hour...sorry about this!

Jim

Jim - FooBar();

unread,
Aug 4, 2012, 3:02:39 PM8/4/12
to clo...@googlegroups.com
Clojars has been updated with a clojure-encog jar containing all the namespaces...I'm really sorry I can't believe I hadn't noticed that! The code is in complete sync with github at the moment so instead of typing 'doc' all the time feel free to have a browser open...I've not changed much - I just removed some redundant let bindings and added ability to create an empty dataset... I also added a simple k-means clustering example. If i understood correctly what you're doing the closest example regarding preparing/normalising your data is the predict-sunspots example...

Hope that helps... :)

Jim

ps: empirically,  tanh and sigmoid work almost always best...I can say the same for the nuygen-widrow randomiser...Also, just so you know I'll be renaming clojure-encog to "enclog" for the 0.5 release...

Jim - FooBar();

unread,
Aug 4, 2012, 3:08:06 PM8/4/12
to clo...@googlegroups.com
I will address your second issue shortly...You say you have a lazy-seq of arrays that have 5 strings? why strings?

Jim

Jim - FooBar();

unread,
Aug 4, 2012, 3:19:01 PM8/4/12
to clo...@googlegroups.com
Hmmm, I think it is worth downloading the source for encog 3.1 for java and look into: org.encog.ml.data.temporal.TemporalMLDataSet

I think this is what you need to add several columns...unfortunately I've not wrapped this yet so you will have to do some interop to get it going...I promise you it will be the first thing I look at as soon as I find some time...

hope that helps...

Jim

Timothy Washington

unread,
Aug 4, 2012, 5:47:34 PM8/4/12
to clo...@googlegroups.com
Hey Jim, 

Thanks for looking into these things. I tried removing clojure-encog from lib/ and .m2/ . But 'lein deps' still pulls in a jar without the normalization.clj file. Do I need an updated [clojure-encog "0.4.x-SNAPSHOT"]

Also, I'll take a peek at the source for 'org.encog.ml.data.temporal.TemporalMLDataSet'. As for the structure of the tick data, I used clojure-csv to to pull that data from this CSV file (you'll have to download as it's large). So it's easy for me to convert those strings to doubles, datetimes, etc. 


This helps a great deal 

Cheers 

Jim - FooBar();

unread,
Aug 4, 2012, 5:59:09 PM8/4/12
to clo...@googlegroups.com
On 04/08/12 22:47, Timothy Washington wrote:
Thanks for looking into these things. I tried removing clojure-encog from lib/ and .m2/ . But 'lein deps' still pulls in a jar without the normalization.clj file. Do I need an updated [clojure-encog "0.4.x-SNAPSHOT"]

aaa sorry! yes you now need 0.4.1-SNAPSHOT...


As for the structure of the tick data, I used clojure-csv to to pull that data from this CSV file (you'll have to download as it's large). So it's easy for me to convert those strings to doubles, datetimes, etc.

cool! i think read-string should do it anyway (at least for numbers)


This helps a great deal

that is good to know... cheers!

Jim




Timothy Washington

unread,
Aug 4, 2012, 6:08:05 PM8/4/12
to clo...@googlegroups.com
Ah, it looks like I have the right jar now. 

And one more thing. I'm looking at the TemporalMLDataSet.java source, and I keep on seeing references to a 'windowSize'. What is a inputWindowSize and a predictWindowSize


Thanks 

Jim - FooBar();

unread,
Aug 4, 2012, 6:21:00 PM8/4/12
to clo...@googlegroups.com
On 04/08/12 23:08, Timothy Washington wrote:
And one more thing. I'm looking at the TemporalMLDataSet.java source, and I keep on seeing references to a 'windowSize'. What is a inputWindowSize and a predictWindowSize


I suppose your window-size is how far back from the present you want to look each time...it needs to be compatible with your input layer...a window-size of 30 with 5 indicators would give you 150 (3*50=150) input neurons as confirmed in this post:

http://www.heatonresearch.com/node/2124


Jim



 

Timothy Washington

unread,
Aug 4, 2012, 6:35:52 PM8/4/12
to clo...@googlegroups.com
Ok, this makes sense. 

Thanks very much for your insights. 


Tim Washington 



--

Jim - FooBar();

unread,
Aug 4, 2012, 7:15:17 PM8/4/12
to clo...@googlegroups.com
No worries...

 looking at the examples.clj in 0.4.1-SNAPSHOT, it is likely it won't even compile which is good evidence of how much your first email made me jump!!! If you want to run the examples just copy-paste the entire code in a namespace of your own while commenting out the travelling-salesman-problem  example. that should sort any compilation issues...

Jim

Timothy Washington

unread,
Aug 5, 2012, 2:31:35 PM8/5/12
to clo...@googlegroups.com
Heyya, 

So I got to playing with the core encog-java system. This thread is getting a bit long, so I put my thoughts into a new thread here: Playing with clojure-encog, Machine-Learning wrapper . 

But the thrust is that I need to know how I can give the encog neural net a list of tick data that has second or sub-second intervals? Have a look. Any insights are appreciated. 


Thanks :) 
Reply all
Reply to author
Forward
0 new messages