Code Monkey home page Code Monkey logo

Comments (8)

sauln avatar sauln commented on June 13, 2024

Hey, that’s a great idea! I don’t think the implementation would be too tricky. Are you interested in giving it a shot? It would be a great first time contribution. I don’t have any bandwidth for this myself, but could help with reviews and releasing the changes once they’re implemented.

from kepler-mapper.

xgao32 avatar xgao32 commented on June 13, 2024

I might be interested if I knew more python. I would look into other graphing packages as well but Mapper has great visualization abilities which is very appealing.

from kepler-mapper.

deargle avatar deargle commented on June 13, 2024

Can you post an example networkx dataset, with what you'd want it to look like? I'm having a hard time imagining, I've never worked with networkx.

And do you know javascript? The edge-drawing logic is implemented both in python and also in javascript. Actually I just realized that the javascript PR was never merged. Here it is in javascript. https://github.com/scikit-tda/kepler-mapper/pull/231/files#diff-e18cbd76668f2d81f3de161789979b48d4d0892b76458ad212722d374a22cc39R633-R679
(and here is the same logic in python

# Create links when clusters from different hypercubes have members with the same sample id.
candidates = itertools.combinations(nodes.keys(), 2)
for candidate in candidates:
# if there are non-unique members in the union
if (
len(set(nodes[candidate[0]]).intersection(nodes[candidate[1]]))
>= self.min_intersection
):
result[candidate[0]].append(candidate[1])
edges = [[x, end] for x in result for end in result[x]]
simplices = [[n] for n in nodes] + edges
return result, simplices
)

Also, fyi, the javascript visualization currently doesn't do anything with edge weights, but it could.

from kepler-mapper.

xgao32 avatar xgao32 commented on June 13, 2024

I made a simple example for a graph with 5 vertices and varying edge weights connecting every vertices. The drawing from networkx shows a complete graph. I would like to be able to play around with the threshold for the edge weight in Mapper to decide when to show two vertices are connected or not.

I cannot claim to understand javascript but I think if one adds an if statement to check that the edge weight between nodes i and j is above or below some threshold before line 646, then it will accomplish what I am thinking of.

from kepler-mapper.

xgao32 avatar xgao32 commented on June 13, 2024

This example of an interactive persistence diagram is very close to what I am thinking of.

from kepler-mapper.

deargle avatar deargle commented on June 13, 2024

How does an "edge weight" relate to kepler-mapper's "min intersection" argument? I suppose actually that your use-case doesn't use kmapper.map at all -- you're just using kmapper.visualize with your own graph (right?). Therefore, you don't have a concept of a "min intersection." It would be helpful to see where you use kmapper functions in your workflow.

from kepler-mapper.

xgao32 avatar xgao32 commented on June 13, 2024

This example of an interactive persistence diagram is very close to what I am thinking of.

The author of the example told me that the interactivity was just a series of pre-generated persistence diagrams and nothing was updated dynamically.

How does an "edge weight" relate to kepler-mapper's "min intersection" argument? I suppose actually that your use-case doesn't use kmapper.map at all -- you're just using kmapper.visualize with your own graph (right?). Therefore, you don't have a concept of a "min intersection." It would be helpful to see where you use kmapper functions in your workflow.

I should have specified that the vertices in my graph are associated with a real number in [0, M], where M is the max value of all vertex values in the graph. The graph is not complete and the edge weight between 2 vertices is the absolute difference between the 2 vertex values. All the vertices in the graph will be grouped according to their values, say one group for values in [0, a] and another for values in [a, M]. The "min intersection" can be some number delta so that some vertices will belong to the group [a - delta, a+ delta] and those vertices will "connect" the 2 vertices in the Mapper graph.

To summarize, edge weight is not directly related to min intersection from my description. I am primarily interested in seeing how the membership of the vertices in the Mapper graph changes with different thresholds on edge weights to decide when 2 vertices in the original graph is connected. Does this help?

from kepler-mapper.

deargle avatar deargle commented on June 13, 2024

I need to see exactly how and where in your flow you are currently using any code specifically from the kepler-mapper library.

I am guessing now that you're just using the plotlyviz stuff, which is totally separate from the .visualize javascript stuff.

from kepler-mapper.

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.