nerdexam
Microsoft

70-774 · Question #63

You have the following HiveQL query in an Import Data module. Which type of operation is being performed?

The correct answer is D. stratified sampling. Random sampling is stratified with respect to a categorical variable when the samples obtained have categorical values that are present in the same ratio as they were in the parent population. Using the same example as above, suppose your data has the following observations by st

Prepare data for modeling

Question

You have the following HiveQL query in an Import Data module. Which type of operation is being performed?

Exhibit

70-774 question #63 exhibit

Options

  • Asampling a bucketized table
  • Brandom sampling by groups
  • Cuniform random sampling
  • Dstratified sampling

How the community answered

(20 responses)
  • A
    15% (3)
  • B
    5% (1)
  • C
    5% (1)
  • D
    75% (15)

Explanation

Random sampling is stratified with respect to a categorical variable when the samples obtained have categorical values that are present in the same ratio as they were in the parent population. Using the same example as above, suppose your data has the following observations by states: NJ has 100 observations, NY has 60 observations, and WA has 300 observations. If you specify the rate of stratified sampling to be 0.5, then the sample obtained should have approximately 50, 30, and 150 observations of NJ, NY, and WA respectively. Here is an example query: SET sampleRate=<sample rate, 0-1>; field1, field2, field3, ..., fieldN, state field1, field2, field3, ..., fieldN, state, count() over (partition by state) as state_cnt, rank() over (partition by state order by rand()) as state_rank from <table name> where state_rank <= state_cnt'${hiveconf:sampleRate}' https://docs.microsoft.com/en-us/azure/machine-learning/team-data-science-process/sample-

Topics

#HiveQL#stratified sampling#data sampling#Import Data

Community Discussion

No community discussion yet for this question.

Full 70-774 Practice