Giter Site home page Giter Site logo

Comments (4)

ntfrgl avatar ntfrgl commented on August 24, 2024

Bug report by Marlene Kretschmer (I experienced simmilar problems several time before):

*... konstruieren ich gerade probeweise mid-latitude networks (1872 Knoten) mit der "normalen" cross correlation und verschiedenen time-lags (0, 1, 7, 14 Tage). Also in etwa so:
*

#!python

# lag 1: 

# initialize matrix
A_1 = numpy.zeros((1872, 1872))

for i in range(1872):
    for j in range(1872):
            CC = core.Data.calculate_cross_correlation(summer_anomaly[:, i], summer_anomaly[:, j], max_delay=15, gamma=0, normed=False)

            # 0.5 ist der threshold
            if numpy.fabs(CC[15]) >= 0.5: 
                A_1[i, j] = 1
            else:
                A_1[i, j] = 0

net_lag1 = core.Network(A_1)
degree_lag1 = net_lag1.get_degree()

*Für größere lags kriege ich allerdings die Fehlermeldung bei Aufruf von get_degree():

File "/iplex/01/sys/applications/pik-python/lib/python2.7/site-packages/pyunicorn/core/network.py", line 1738, in get_degree
k = self.get_outdegree()
File "/iplex/01/sys/applications/pik-python/lib/python2.7/site-packages/pyunicorn/core/network.py", line 1778, in get_outdegree
spmatrix.matrixmultiply(self.sparse_A, self._sp_ones)).
File "/iplex/01/sys/applications/pik-python/lib/python2.7/site-packages/pyunicorn/core/network.py", line 1796, in _sparse_to_column
v.put(np.array(self._get_sparse_keys(matrix))[:, 0], matrix.values())
IndexError: too many indices

Ich vermute, dass es daran liegt, dass die Adjacency Matrix dann keine Einträge ungleich Null hat? Zumindest klappt es wenn ich den threshold auf 0.1 runter setze.*


Original comment by: Jonathan Donges
Original comment on: 2014-09-24

from pyunicorn.

ntfrgl avatar ntfrgl commented on August 24, 2024

Should be resolved by the still experimental code ported to scipy.sparse. @jdonges: minimal reproducible case for testing?


Original comment by: ntfrgl
Original comment on: 2014-09-24

from pyunicorn.

ntfrgl avatar ntfrgl commented on August 24, 2024

Here is a minimal example:

#!python

from pyunicorn import Network

g = Network(np.zeros((2,2)))
g.get_degree()


Original comment by: Jonathan Donges
Original comment on: 2014-09-25

from pyunicorn.

ntfrgl avatar ntfrgl commented on August 24, 2024

Commit 5a6b858 seems to do the job.


Original comment by: ntfrgl
Original comment on: 2014-10-01

from pyunicorn.

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.