Skip to content

Conversation

@ccoffrin
Copy link
Member

Preliminary tests on current data look resonable. I suggest we merge this into master.

Here is a little script I am currently using for testing.

#!/usr/bin/env julia

using ArgParse
using JSON
using GraphicalModelLearning
using Ipopt

function main(args)
    samples = readcsv(args["samples"])

    gm = learn(samples, multiRISE(0.0, false, args["order"]), NLP(IpoptSolver(tol=1e-12)))

    data = []
    for (k,v) in sort(collect(gm), by=(x) -> abs(x[2]), rev=true)
        println(k, " => ", v)
        push!(data, Dict("term" => k, "weight" => v))
    end
    println()

    open(args["model"], "w") do f
        write(f, JSON.json(data))
    end
end

function parse_commandline()
    s = ArgParseSettings()

    @add_arg_table s begin
        "--samples", "-s"
            help = "the samples input data file (.csv)"
            required = true
        "--model", "-m"
            help = "the model output data file (.json)"
            required = true
        "--order", "-o"
            help = "the model order"
            default = 4
            arg_type = Int64
    end

    return parse_args(s)
end

if isinteractive() == false
    main(parse_commandline())
end

@marc-vuffray marc-vuffray merged commit 3ed16a4 into master Nov 23, 2017
@ccoffrin ccoffrin deleted the multi-interactions branch November 26, 2017 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants