Code Monkey home page Code Monkey logo

infotheory's People

Contributors

danielskatz avatar madvn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

infotheory's Issues

I have an issue installing the package

I have clone the repository.
When I run pip install infotheory I get the following errors:

Collecting infotheory
Using cached infotheory-1.0.01.tar.gz (19 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: infotheory
Building wheel for infotheory (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
C:\Users\a-v-d\anaconda3\envs\MasterThesis\lib\site-packages\setuptools\dist.py:314: InformationOnly: Normalizing '1.0.01' to '1.0.1'
self.metadata.version = self._normalize_version(self.metadata.version)
PyLinker.cpp
C:\Users\a-v-d\AppData\Local\Temp\pip-install-__062f80\infotheory_d9c2c9609954478b9b95cf02d1db283a\infotheory\InfoTools.h(71): warning C4244: 'argument': conversion from 'double' to 'EltType', possible loss of data
with
[
EltType=int
]
C:\Users\a-v-d\AppData\Local\Temp\pip-install-__062f80\infotheory_d9c2c9609954478b9b95cf02d1db283a\infotheory\InfoTools.h(79): warning C4244: 'argument': conversion from 'double' to 'EltType', possible loss of data
with
[
EltType=int
]
C:\Users\a-v-d\AppData\Local\Temp\pip-install-__062f80\infotheory_d9c2c9609954478b9b95cf02d1db283a\infotheory\InfoTools.h(1333): warning C4244: 'argument': conversion from 'double' to 'EltType', possible loss of data
with
[
EltType=int
]
./infotheory\PyLinker.cpp(25): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
./infotheory\PyLinker.cpp(33): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data
LINK : error LNK2001: unresolved external symbol PyInit_infotheoryClass
build\temp.win-amd64-cpython-39\Release./infotheory\infotheoryClass.cp39-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\bin\HostX86\x64\link.exe' failed with exit code 1120
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for infotheory
Running setup.py clean for infotheory
Failed to build infotheory
ERROR: Could not build wheels for infotheory, which is required to install pyproject.toml-based projects

I do have BuildTools downloaded on my computer.
Is there anythin I am missing?

Silent mis-handling of NaNs in input data

Hi, you're probably not even maintaining this anymore, but in case you do, I've found that NaNs in the input data are not handled correctly, I think. In case you want to add something about this in the docs...

I'm not sure exactly what happens, but if I have a matrix with 3 columns, and I make some values in the third column NaNs, that will affect calculations of MI between the first two:

import infotheory
import numpy as np

it = infotheory.InfoTools(dims=3, nreps=0)
it.set_equal_interval_binning(nbins=[10, 10, 10], mins=[0, 0, 0], maxs=[1, 1, 1])

mat = np.random.default_rng(42).random((100, 3))
# mat[40:50, 2] = np.nan

it.add_data(mat)
it.mutual_info([0, 1, -1])

Without NaNs in the third variable the resulting MI between the first two variables is 0.6699268749439261. With NaNs, the result is 0.7039212101565637. So the strange thing is that data in an unrelated variable affects the MI between the first two.

After a quick Iook only, one thing that may be happening is that PyFloat_AsDouble may silently convert NaNs to -1 (https://docs.python.org/3/c-api/float.html#c.PyFloat_AsDouble) perhaps? Which would then mean that the minima passed in are not correct anymore. Though I don't know how this would then affect unrelated variables.

Let me know if you want me to help out addressing this, if you're still aiming to support this package.

Btw, I'm an old friend of Eduardo Izquierdo's ;)

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.