Coder Social home page Coder Social logo

Comments (4)

hadley avatar hadley commented on August 28, 2024

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down the page.

from multidplyr.

cwaldock1 avatar cwaldock1 commented on August 28, 2024

Have only run into the error once, and thought it might be a bug somewhere in multidplyr. The example is a similar scale to the data I was running at the time.

Cheers

## -- ## 
library(devtools)
install_github("mfasiolo/qgam")
library(qgam)
library(dplyr)
library(multidplyr)
library(purrr)

# Create tibble
# Groups
TestData <- as_data_frame(data.frame(Group1 = sort(as.factor(rep(1:3000, length.out = 6000))), 
                          Group2 = as.factor(rep(1:2))))

# Variables
TestData <- TestData %>% 
  group_by(Group1, Group2) %>% 
  do(x = seq(1:1000),
     y = rnorm(1000)) %>% 
  unnest(x,y)
                    
# Optional subset to smaller scale for speed. 
#TestData <- TestData[1:10000,]

#  Detect clusters
parallel::detectCores() # 4 cores

# Create groups
group <- rep(1:4, 
             length.out = nrow(TestData %>% group_by(Group1, Group2) %>% nest()))
TestData2 <- bind_cols(tibble(group), TestData %>% group_by(Group1, Group2) %>% nest())
TestData2 <- TestData2 %>% unnest(data)

# Create clusters
cluster <- create_cluster(cores = 4)

# Create partition dataframe
TestDataParty <- TestData2 %>% partition(group, cluster = cluster)

# Load library for within each cluster
cluster_library(TestDataParty, "qgam")

# Run models in parallel 
TestDataPartyOutput <- TestDataParty %>% group_by(Group1, Group2) %>% 
  do(Model1 = tryCatch(qgam(y ~ s(x, k = 3), qu = 0.95, data = .), error = function(e) NA),
     Model2 = tryCatch(qgam(y ~ s(x, k = 4), qu = 0.95, data = .), error = function(e) NA),
     Model3 = tryCatch(qgam(y ~ s(x, k = 5), qu = 0.95, data = .), error = function(e) NA),
     Model4 = tryCatch(qgam(y ~ s(x, k = 7), qu = 0.95, data = .), error = function(e) NA))

from multidplyr.

mschilli87 avatar mschilli87 commented on August 28, 2024

I ran into the same problem and 'resolved' it by re-initiating my cluster. I did not change any code, just re-ran the cluster setup (incl. library loading and data copying).

from multidplyr.

hadley avatar hadley commented on August 28, 2024

Seems unlikely to be a bug in multidplyr, but if you're still interested, and can create a simple reprex, please file a new issue.

from multidplyr.

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.