hgr
hgr

Reputation: 326

What is use of SFrame.materialize() in Graphlab?

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.

Upvotes: 1

Views: 717

Answers (2)

Rajeev Mehndiratta
Rajeev Mehndiratta

Reputation: 11

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

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

Upvotes: 0

Tomáš Linhart
Tomáš Linhart

Reputation: 10220

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.

Upvotes: 0

Related Questions