Giter Site home page Giter Site logo

Comments (6)

ulupo avatar ulupo commented on June 6, 2024

Hi! Thanks for the details. Would you be able to produce a minimal code example which illustrates the issue?

from giotto-tda.

jnukpezah avatar jnukpezah commented on June 6, 2024

Hi!, Yes I can. The code example is below. Thanks.

Define filter function

filter_func = umap.UMAP(n_neighbors=5)

Define cover

cover = CubicalCover(kind='balanced', n_intervals=10, overlap_frac=0.2)
#cover = CubicalCover(n_intervals=10, overlap_frac=0.2)

Choose clustering algorithm

clusterer = DBSCAN(eps=10)

Initialise pipeline

pipe = make_mapper_pipeline(
filter_func=filter_func,
cover=cover,
clusterer=clusterer,
verbose=True,
n_jobs=-1,
)

Plot Mapper graph where df_refined is a Pandas dataframe

fig = plot_static_mapper_graph(pipe, df_refined, color_data = df_refined)
fig.show(config={'scrollZoom': True})

#Node_elements from attributes.
graph = pipe.fit_transform(df_refined)
node_elements = graph.vs["node_elements"]

from giotto-tda.

jnukpezah avatar jnukpezah commented on June 6, 2024

When I hover over the nodes in the plot_static_mapper graph and match the same node in the node_elements, the node sizes are different. Thanks

from giotto-tda.

ulupo avatar ulupo commented on June 6, 2024

Thanks @jnukpezah! I can reproduce using the example provided.

The issue does not seem to come from giotto-tda but rather from UMAP. Indeed, the UMAP class constructor has a random_state parameter, which is by default set to None, meaning that a "random random seed" is generated every time fit is called. Thus, running the UMAP part of the Mapper pipeline gives different results every time.

To have a fully reproducible pipeline, and solve your issue, set random_state in UMAP to some integer value of your choice.

from giotto-tda.

jnukpezah avatar jnukpezah commented on June 6, 2024

Hi @ulupo Got it! Thanks for the insight. Will do so! Great library btw!

from giotto-tda.

ulupo avatar ulupo commented on June 6, 2024

Great! Happy to help!

from giotto-tda.

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.