Giter Club home page Giter Club logo

Comments (2)

pawel-czyz avatar pawel-czyz commented on May 27, 2024

It's possible that there's a bug somewhere, but I can't obtain good results by running this package.

I implemented a simple script:

using CSV
using DataFrames
# using YAML
using TransferEntropy

samples_filename = ARGS[1]
seed = parse(Int, ARGS[2])
dim_x = parse(Int, ARGS[3])
dim_y = parse(Int, ARGS[4])


# metadata = YAML.load_file(metadata_filename)
# show(metadata)
# dim_x = metadata["dim_x"]
# dim_y = metadata["dim_y"]

df = CSV.File(samples_filename) |> DataFrame

df = df[df.seed .== seed, :] 

x_samples = Dataset(Matrix(df[:, 2:1+dim_x]))
y_samples = Dataset(Matrix(df[:, 2+dim_x: 1+dim_x+dim_y]))

# show(x_samples)
# show(y_samples)


mi = mutualinfo(x_samples, y_samples, Kraskov())
println(mi)


mi = mutualinfo(x_samples, y_samples, Kraskov1())
println(mi)


mi = mutualinfo(x_samples, y_samples, Kraskov2())
println(mi)


mi = mutualinfo(x_samples, y_samples, KozachenkoLeonenko())
println(mi)


est = VisitationFrequency(RectangularBinning(0.1))
mi = mutualinfo(x_samples, y_samples, est)
println(mi)


est = VisitationFrequency(RectangularBinning(0.2))
mi = mutualinfo(x_samples, y_samples, est)
println(mi)


est = VisitationFrequency(RectangularBinning(0.5))
mi = mutualinfo(x_samples, y_samples, est)
println(mi)

est = VisitationFrequency(RectangularBinning(1))
mi = mutualinfo(x_samples, y_samples, est)
println(mi)

and generated a task using split multinormal sampler:

dim_x: 1
dim_y: 2
mi_true: 0.5108256237659909
n_samples: 5000
task_id: some-correlation

Then I ran the script:

$ julia mi_estimator.jl testdir/samples.csv 1 1 2

and obtained:

-Inf
2.0348837647400924
2.405459973695475
-Inf
3.5470532390132483
1.7091615702982228
0.8061644481070918
0.0

Some ideas:

  1. Perhaps the unit is different (and it's not nats, but something else).
  2. Maybe the conversion from the data frame to data set is wrong.

from bmi.

pawel-czyz avatar pawel-czyz commented on May 27, 2024

This has been added using TransferEntropy.jl library.

from bmi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.