Why code is running too slow with GraphLab Create?

User 2445 | 10/19/2015, 12:59:49 AM

Hi, I was trying to run code lines but it takes a lot time to run. I tried change runtime_config but does not work. Please help! I'm taking Coursera ML course and I can not advance :neutral:


User 1178 | 10/19/2015, 4:49:46 PM


Can you give more details here? The code in the Coursera ML course usually finish quite quick. Which notebook and which line are you trying to run? More information regarding your Operation System and hardware configuration is also helpful in diagnostic the issue.

Thanks! Ping

User 2485 | 10/26/2015, 1:07:30 PM

I am having the same problem as well.the following statement takes forever to run (never completes)

traindata2,testdata2 = products.randomsplit(.8, seed=0) sentimentmodel = graphlab.logisticclassifier.create(traindata2, target='sentiment', features=selectedWords, validationset=testdata2)

User 4 | 10/26/2015, 9:07:38 PM

Hi @sidz77 -- can you link to the specific Coursera page that has this issue? As I recall there was a performance issue from the Week 3 content. Can you browse to https://www.coursera.org/learn/ml-foundations/discussions/uk5mhW7JEeWqXg7D-Kwb-Q ? (In case you don't have access to that page, I can try to share the material here):

Suggested workaround #1: set validation_set=None. This seemed to help some people, but only a little bit.

Suggested workaround #2: Make sure you use the apply function on an SArray (single column), not SFrame (whole table). The per-column apply is much, much faster, and the performance bleeds into other function execution like logistic_classifier.create due to lazy evaluation. An example of this would be to do (fast):

func = lambda p: 1 if 'awesome' in p else 0 products['awesome'] = products['word_count'].apply(func)

Instead of (slow):

func = lambda p: 1 if 'awesome' in p['word_count'] else 0 products['awesome'] = products.apply(func)