Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4625210
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:14:21+00:00 2026-05-22T03:14:21+00:00

Running e.g. cv.glmnet on a dataset gives me (by default) 100 different models. Now,

  • 0

Running e.g. cv.glmnet on a dataset gives me (by default) 100 different models. Now, if my dataset had missing data, I could do multiple imputation (say 10 imputations) and run cv.glmnet on each of the imputations.

If I disregard the actual coefficient values for each of the models, and just look at the selected features (i.e. sets of column names), some models are submodels of others.

Code like this imitates the results somewhat:

usevars<-paste("var", 1:100, sep="")
mdls<-replicate(1000, {
        numVars<-sample.int(length(usevars), 1)
        sample(usevars, numVars)
    })
names(mdls)<-paste("mdl", 1:1000, sep="")

Now, it’s easy enough to get the parent-child relations for submodels in this respect. It is also possible to only include ‘direct parenthood’ (i.e. if model A is child of B and B is child of C, then don’t include the relation between A and C).

Finally, I come to my problem: I’ve used igraph to plot these models and their (direct) relations. I did not, however, find a layout that could group the nodes based on another variable (in this case the model size): in this setting it seems like a good idea to create this graph holding ‘bands’ of models with the same model size (number of variables in the model).

What I ended up doing, was more or less calculate the positions of each node myself through a kludge of code (that I’m too embarassed about to be posting here), but I always kept wondering if I simply missed a better / out-of-the-box solution.

My own code resulted in graphs like this one (you can ignore the colours and the labels – just know that the horizontal axis holds the model size):
enter image description here

Suggestions for achieving this sort of graph more elegantly than, well, doing all the hard work myself, are greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T03:14:22+00:00Added an answer on May 22, 2026 at 3:14 am

    The Fruchterman-Reingold layout algorithm in the development version of igraph (that is, 0.6, which is not released officially yet, but you can ask Gábor on the mailing list to send you a copy) has two hidden (i.e. yet undocumented) parameters: miny and maxy. They allow you to constrain the Y coordinates of nodes within a range, so you can use this to create layers.

    Alternatively, I’m working on an implementation of the Sugiyama layered graph layout method for igraph right now and I will merge it to the development tree in a day or two (if things go well), and then you can try that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running a rails site right now using SQLite3. About once every 500 requests or
Running Nh 3.2 using SQLite throws the following exception: ---> NHibernate.HibernateException: Could not create
running the configure script for mozart oz gives me this: checking for stdint.h... (cached)
Running by hand, adb shell su chmod 666 /dev/graphics/fb0 export CLASSPATH=/data/local/device.jar export LD_LIBRARY_PATH=/data/local exec
Running test.py gives Traceback (most recent call last): File test.py, line 3, in <module>
Running the following query in SQL Server Management Studio gives the error below. update
Running hudson it is easy but currently the documentation is missing the tutorial for
running git instaweb in my repository opens a page that says 403 Forbidden -
Running into a problem where on certain servers we get an error that the
Running FxCop on my code, I get this warning: Microsoft.Maintainability : 'FooBar.ctor is coupled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.