Need help to store a SVM Model

2014-02-24 Thread Goldritter
Hi, I wanted to use the Java library of the libsvm (http://www.csie.ntu.edu.tw/~cjlin/libsvm/) jlibsvm (http://dev.davidsoergel.com/trac/jlibsvm/) to learn a Support Vector Machine and then store the learned model into a MongoDB (used kernel, support vectors, alphas, label(s), rho, ...). A

Wrong documentation of contains?

2013-08-07 Thread Goldritter
In an program I used the result of keys as an argument for a function which verifies whether an object is in a passed collection or not. The result I got was following Exception: IllegalArgumentException contains? not supported on type: clojure.lang.APersistentMap$KeySeq

Find maps with embedded functions in a set

2013-07-31 Thread Goldritter
I have following problem. I have a set with different objects (maps). Normally the maps contains only a key with a value which is a number or a collection. For example like this: (def testset #{ {:a 3 :b 5 :c 6} {:a 3 :b 5 :c 7} {:a 3 :b 5 :c 8}

clojure.set/union bug?

2013-07-01 Thread Goldritter
I wanted to create a union of the keys from two maps. When I write (clojure.set/union (keys {:a 1 :b 2 :c 3}) (keys {:a 1 :b 2 :c 3})) I get a result of (:b :c :a :a :c :b). When I write (set (clojure.set/union (keys {:a 1 :b 2 :c 3}) (keys {:a 1 :b 2 :c 3}))) the result is #{:a :c :b}. The

How to add the comment of a function into the compiled java class

2012-11-15 Thread Goldritter
Hi, I try add Clojure into a Java project. Therefore I write my code in Clojure and then compile the clj-File to Java classes and use these compiled classes in my Javacode. My problem is, that the commentary I wrote for the clojure function is not shown in the compiled java class or the method

Found bug in contains? used with vectors.

2012-09-03 Thread Goldritter
I use Clojure 1.4.0 and wanted to use 'contains?' on a vector and get following results: = (contains? [1 2 3] 3) false = (contains? [1 2 3] 2) true As it seems 'contains?' does not check for the last entry in the vector. And an other question. Why does contains? returns everytime 'false' when

Re: Found bug in contains? used with vectors.

2012-09-03 Thread Goldritter
3 has the key 2, but not key 3. Thanks, Ambrose On Mon, Sep 3, 2012 at 7:03 PM, Goldritter marcus.goldr...@googlemail.comjavascript: wrote: I use Clojure 1.4.0 and wanted to use 'contains?' on a vector and get following results: = (contains? [1 2 3] 3) false = (contains? [1 2 3] 2

Would adef- macro for private varibales make sense?

2012-06-30 Thread Goldritter
For functions I have a defn macro to create public functions and a defn- macro to define private functions. For variables I have only def. Would it make sense to also have a def macro for public variables and a def- macro for private variables, also variables which can be only accessed from

When I use Agents for logging I have a different behavior in the REPL as in the program

2012-04-22 Thread Goldritter
I wanted to log some information during the execution of the genetic algorithm I posted earlier herehttps://groups.google.com/forum/?fromgroups#!topic/clojure/mwFTyEA0xvY. So I chnaged the code and changed the function 'track-evolution' so, that it now accept a maximal runtime and returns a

Re: Need help to find a bug in a genetic algorithm

2012-04-02 Thread Goldritter
First there is an error in my code :( These are the allowed symbols from which the creator function can choose to create or mutate a gen: def allowed-symbols (str abcdefghijklmnopqrstuvwxyzäöü ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜ)) This is the targetd which should be fulfilled:

Better ways to make time tansformations?

2012-03-30 Thread Goldritter
I wanted to track a program and set a maximum runtime for it in a way which is readable for the user. So I needed to write a time tansformation which I could use in my track function. First I wanted to use something like the 'defunits' macro from Let over Lambda from Doug Hoyte, but I'm not so fit

Is it possible to get only the time with the function 'time'

2012-03-28 Thread Goldritter
I wanted to aks if it is possible to get only the passed milliseconds from the function 'time' without the sentence Elapsed time: 0.119 msecs. I would only need the 0.119 and best as a number and not as a String. Or have I to write a function which extracts the number out of the String? -- You

Need help to find a bug in a genetic algorithm

2012-03-25 Thread Goldritter
For my little project I wanted to reprogramm the gentic algorithm from the book Clojure written by Stefan Kamphausen and Tim Oliver Kaiser. All the basicfunction like creating the population, selecting individuals, adding individuals, removing individuals and recombination works fine. During the