### ### UCI MAGIC Gamma Telescope Data ### Local copy: magic.csv Downloaded From: https://www.openml.org/d/1120 (CSV file: https://api.openml.org/data/v1/get_csv/54003) Original Source: UCI Machine Learning Repository https://archive.ics.uci.edu/dataset/159/magic+gamma+telescope Variable Information: Name -- Data Type -- Measurement -- Description ID -- not a feature. should be removed. fLength -- quantitative -- mm -- major axis of ellipse fWidth -- quantitative -- mm -- minor axis of ellipse fSize -- quantitative -- log10(#phot) -- 10-log of sum of content of all pixels fConc -- quantitative -- ratio -- ratio of sum of two highest pixels over fSize fConc1 -- quantitative -- ratio -- ratio of highest pixel over fSize fAsym -- quantitative -- mm -- distance from highest pixel to center, projected onto major axis fM3Long -- quantitative -- mm -- 3rd root of third moment along major axis fM3Trans -- quantitative -- mm -- 3rd root of third moment along minor axis fAlpha -- quantitative -- deg -- angle of major axis with vector to origin fDist -- quantitative -- mm -- distance from origin to center of ellipse class -- binary (g, h) -- none -- g = gamma (signal), h = hadron (background) -- response variable Summary: Number of instances (observations): 19020 Number of Attributes: 11 Attribute breakdown: 10 quantitative feature variables, and 1 binary response variable Missing Attribute Values: None Class distribution: g (gamma, signal) = 12332 (64.8%), h (hadron, background) = 6688 (35.2%) Abstract: Data are Monte Carlo generated to simulate the registration of high energy gamma particles in an atmospheric Cherenkov telescope. The task is to discriminate images caused by primary gamma rays (signal) from images of hadronic showers initiated by cosmic rays in the upper atmosphere (background). Data Characteristics: The data were generated by the Monte Carlo program CORSIKA, run with parameters allowing events with energies down to below 50 GeV. Each shower image is pre-processed into an elongated cluster, and a principal component analysis in the camera plane defines an ellipse. The attributes are the characteristic (Hillas) parameters of this ellipse plus further image descriptors. The values are in raw form (not scaled). Notes: The OpenML CSV file also has a first column named ID, a row identifier that is not a feature, and its column names end in a colon (for example "fLength:"). The R code below drops ID and removes the colons. For technical reasons the number of h events is underestimated; in the real data the h class is the majority. Plain classification accuracy is therefore not meaningful, because accepting a background event as signal is worse than rejecting a signal event. The data providers recommend comparing classifiers with an ROC curve, at the points where the probability of accepting a background event as signal is below 0.01, 0.02, 0.05, 0.1 or 0.2. Reference: Bock, R.K., Chilingarian, A., Gaug, M., Hakl, F., Hengstebeck, T., Jirina, M., Klaschka, J., Kotrc, E., Savicky, P., Towers, S., Vaicilius, A., Wittek W. (2004). Methods for multidimensional event classification: a case study using images from a Cherenkov gamma-ray telescope. Nucl. Instr. Meth. A, 516, pp. 511-528. ---------- library(tidyverse) DF <- read_csv("magic.csv", check.names=FALSE) # keep names exactly as in the file DF1 = DF %>% select(-ID) %>% # drop the column "ID" rename_with(~ gsub(":", "", .x)) # remove ":" from column names DF1