1

When I was trying to get the rows of my dataset belonging to column of userid =1 through graphlab's sframe datastructure, sf[sf['userid'] == 1],

I got the rows,however I also got this message, [? rows x 6 columns] Note: Only the head of the SFrame is printed. This SFrame is lazily evaluated. You can use sf.materialize() to force materialization.

I have gone through the documention, yet I can't understand what sf.materialize() do! could someone help me out here.

hgr
  • 178
  • 1
  • 1
  • 10

2 Answers2

0

The note tells you that the operation (filtering in your case) isn't applied to whole date set right away, but only to some portion of it. This is to save resources -- in case the operation doesn't do what you intended, resources want be wasted by applying the operation on whole possibly large data set but only on the needed portion (head in your case, that is output by default). Materialization forces propagation of the operation on the whole data set.

Tomáš Linhart
  • 9,832
  • 1
  • 27
  • 39
  • Thanks that helps! how to use that materialize function then? – hgr Jul 22 '17 at 16:07
  • @harishaaram It's a method of SFrame, so you use as `sf.materialize` (i.e. the way it's stated in the note). You can find slighly more information [here](https://turi.com/learn/userguide/sframe/data-manipulation.html). – Tomáš Linhart Jul 22 '17 at 16:14
0

@harishaaram It is a method from graphlab library, so use as

gl.SFrame.materialize(sf)
dat=sf[sf['userid'] == 1]
dat