Berk U.

Cambridge, MA

berkustun.com

Age: 28

I am a Ph.D. student in the Electrical Engineering and Computer Science Department at MIT. I am interested in developing new methods for data-driven decision-making and using them to solve problems in areas such as climate change, crime prediction, healthcare and revenue management.

1d
revised glmnet error - non-conformable arguments
changed raw_data to df in the example so it runs; clearly a bug
1d
comment glmnet error - non-conformable arguments
@AME Yes your bug was due to the fact that you have NA entries in your X matrix. See my updated response. As @42 says though, you also have all 0s in your outcome, which is not useful, but it doesn't matter as glmnet still works.
1d
revised glmnet error - non-conformable arguments
added 187 characters in body
1d
revised R: creating a categorical variable from a numerical variable and custom/open-ended/single-valued intervals
edited title
1d
revised R: creating a categorical variable from a numerical variable and custom/open-ended/single-valued intervals
added 159 characters in body
1d
comment R: creating a categorical variable from a numerical variable and custom/open-ended/single-valued intervals
@JasonAizkalns I wasn't aware of cut or cut2 but they seem to do the trick. That said, I'm sure how to deal with points (e.g. an interval like [0,0]), and whether it can be incorporated with mutate.
1d
comment R: creating a categorical variable from a numerical variable and custom/open-ended/single-valued intervals
@jamieRowen preferably something that could be passed to mutate.
1d
comment Generating Multiple Variables Dynamically
This was brought up by @G.Grothendieck, though I wanted to emphasize it since it's a cool trick. You should use paste0("variable", i) instead of paste("variable", i, sep = "") to avoid having to specify the sep="" argument everytime.
1d
asked R: creating a categorical variable from a numerical variable and custom/open-ended/single-valued intervals
1d
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
deleted 369 characters in body
2d
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
made example easier to understand
2d
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
added 30 characters in body
Feb
3
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
added 18 characters in body
Feb
3
comment Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
Let us continue this discussion in chat.
Feb
3
comment Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
@ali_m Thanks for pointing that out. I changed the comments so that everything matches up. To answer the questions, half of the entries of rho are typically 0 as is the case in the code, which is probably something to exploit. However, Z is not typically sparse (in some cases, it will be exclusively composed only of -1,0,1; however, since I didn't put that in the sample code, I will leave it as a follow-up post).
Feb
3
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
changed example code
Feb
3
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
changed example code
Feb
2
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
added 39 characters in body
Feb
2
comment Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
@ali_m Thank you for pointing this out! I was actually doing the computation in the way you suggested in my actual build so I integrated it into the sample code (had written it different in the original post because it was easier to explain what was happening, though I did not realize that it would make such a huge difference). I also added a line at the end to make sure that BLAS was linked. Multithreading is really not an option in this case unfortunately.
Feb
2
revised Speeding up matrix-vector multiplication and exponentiation in Python, possibly by calling C/C++
added 16 characters in body
1 2 3 4 5