Bowles_2.2_rocks: Classification Problems: Detecting Unexploded Mines Using Sonar

Listing 2-1: Sizing Up a New Data Set—rockVmineSummaries.py (Output: outputRocksVMinesSummaries.txt)

  • CSV einlesen
  • Number of Rows / Cols

Listing 2-2: Determining the Nature of Attributes—rockVmineContents.py (Output: outputRocksVMinesContents.txt)

  • Col# Number Strings Other

Listing 2-3: Summary Statistics for Numeric and Categorical Attributes—rVMSummaryStats.py (Output: outputSummaryStats.txt)

  • colMean = np.mean(colArray)
  • colsd = np.std(colArray)
  • quantile boundaries
  • unique = set(colData)
  • number of elements having each value: catDict = dict(zip(list(unique),range(len(unique))))

Listing 2-4: Quantile-Quantile Plot for 4th Rocks versus Mines Attribute— qqplotAttribute.py

  • Figure 2-1: Quantile-quantile plot of attribute 4 from rocks versus mines data

Listing 2-5: Using Python Pandas to Read and Summarize Data—pandasReadSummarize.py

  • pd.read_csv
  • summary = rocksVMines.describe()