Visit the UCI Repository https://archive.ics.uci.edu/. Read the description of the data and download the Mushroom data set
Question:
Visit the UCI Repository https://archive.ics.uci.edu/. Read the description of the data and download the Mushroom data set agaricuslepiota.
data. Using pandas, read the data into a DataFrame called mushroom, via read_csv.
(a) How many features are in this data set?
(b) What are the initial names and types of the features?
(c) Rename the first feature (index 0) to 'edibility' and the sixth feature (index 5) to 'odor' [Hint: the column names in pandas are immutable; so individual columns cannot be modified directly.
However it is possible to assign the entire column names list via mushroom.columns = newcols.]
(d) The 6th column lists the various odors of the mushrooms: encoded as 'a', 'c', Replace these with the names 'almond', 'creosote', etc. (categories corresponding to each letter can be found on the website).
Also replace the 'edibility' categories 'e' and 'p' with 'edible'
and 'poisonous'.
(e) Make a contingency table cross-tabulating 'edibility' and 'odor'.
(f) Which mushroom odors should be avoided, when gathering mushrooms for consumption?
(g) What proportion of odorless mushroom samples were safe to eat?
Step by Step Answer:
Data Science And Machine Learning Mathematical And Statistical Methods
ISBN: 9781118710852
1st Edition
Authors: Dirk P. Kroese, Thomas Taimre, Radislav Vaisman, Zdravko Botev