Exam 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

How do you retrieve a random data value in Python?

Free
(Essay)
4.8/5
(43)
Correct Answer:
Verified

To implement this, we use the randint function from the random module. This random number generator will pick an integer in the range[a,b] including the endpoints. For example, randint(2,5) will return a random integer between 2 and 5 inclusive.

What best describes the type of iteration that is shown in the code below? For num in [1, 2, 3, 4, 5]: Print("hello")

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

A

In the K-means algorithm, the number of clusters is represented by:

Free
(Multiple Choice)
4.7/5
(44)
Correct Answer:
Verified

B

Case Study 3: >>> aLine = next(csvReader) >>> aLine ['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA'] >>> aLine[3] >>> ??? >>> aLine[6:] >>> ??? -Refer to the session in the accompanying Case Study 3. What is printed for aLine[6:]?

(Multiple Choice)
4.8/5
(36)

Case Study 1: 1. def readFile(filename ): 2. with open(filename , "r") as dataFile 3. dataDict = {} 4. 5. key = 0 6. for aLine in dataFile: 7. key = key + 1 8. score = int(aLine) 9. 10. dataDict[key] = [score] 11. 12. return dataDict -Refer to the session in the accompanying Case Study 1. What happens in Line 10?

(Multiple Choice)
4.9/5
(35)

Case Study 3: >>> aLine = next(csvReader) >>> aLine ['3.7', '2006/10/18', '05:34:15', '62.326', '-151.224', '85.9', 'CENTRAL ALASKA'] >>> aLine[3] >>> ??? >>> aLine[6:] >>> ??? -Refer to the session in the accompanying Case Study 3. What is printed for aLine[3]?

(Multiple Choice)
4.8/5
(41)

Case Study 2: 1. total = 0 2. aNum = 1 3. while aNum <= 10: 4. total = total + aNum 5. aNum = aNum + 1 6. print(total) -Refer to the session in the accompanying Case Study 2. Which line represents the initialization of the loop condition?

(Multiple Choice)
4.9/5
(38)

The process of "visualizing" data can be quite useful, especially if one is looking for hard-to-see relationships that may not be readily apparent from long lists of data.

(True/False)
4.9/5
(41)

What is the problem with the loop shown below? 1. total = 0 2) aNum = 1 3) while aNum <= 10: 4) total = total + aNum 5) print(total)

(Multiple Choice)
4.9/5
(38)

One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become too large. Describe how this problem occurs and a possible solution.

(Essay)
5.0/5
(40)

Once the turtle has been directed to the proper location, what method will plot a point using the current tail color?

(Multiple Choice)
4.8/5
(41)

Match each definition with its phrase. -A loop that never stops.

(Multiple Choice)
4.8/5
(35)

Longitude values run west-east, with the zero being the prime meridian, an imaginary line that runs north-south through Greenwich, England.

(True/False)
4.9/5
(36)

Case Study 1: 1. def readFile(filename ): 2. with open(filename , "r") as dataFile 3. dataDict = {} 4. 5. key = 0 6. for aLine in dataFile: 7. key = key + 1 8. score = int(aLine) 9. 10. dataDict[key] = [score] 11. 12. return dataDict -Refer to the session in the accompanying Case Study 1. What is the purpose of the program code [score]?

(Multiple Choice)
4.7/5
(40)

Match each definition with its phrase. -Allows loop body statements to be executed until a condition becomes false.

(Multiple Choice)
5.0/5
(48)

What method is used to set a background image for a turtle screen?

(Multiple Choice)
4.9/5
(45)

One of the weaknesses of the K-means cluster analysis algorithm is that the clusters can become empty. Describe how this problem occurs and its effect.

(Essay)
4.8/5
(39)

A(n) ____ is defined as the mean of a collection of data points.

(Multiple Choice)
4.8/5
(44)

What are the basic steps in the K-means algorithm?

(Essay)
4.9/5
(36)

The equation d = X<sub>2</sub> - X<sub>1</sub> is used to find:

(Multiple Choice)
4.8/5
(41)
Showing 1 - 20 of 31
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)