<jupyter_start><jupyter_text>**EXPERIMENT 1** Aim: Exploring variable in a datasetObjectives:Exploring Variables in a DatasetLearn how to open and examine a dataset.Practice classifying variables by their type: quantitative or categorical.Learn how to handle categorical variables whose values are numerically coded.Link to experiment: https://upscfever.com/upsc-fever/en/data/en-exercises-1.html<jupyter_code>import pandas as pd 
import numpy as np 
import matplotlib.pyplot as plt
depression = pd.read_csv('https://raw.githubusercontent.com/kopalsharma19/J045-ML-Sem-V/master/Lab%20Experiments/Experiment-1%20060720/depression.csv')
friends = pd.read_csv('https://raw.githubusercontent.com/kopalsharma19/J045-ML-Sem-V/master/Lab%20Experiments/Experiment-1%20060720/friends.csv')
actor_age = pd.read_csv('https://raw.githubusercontent.com/kopalsharma19/J045-ML-Sem-V/master/Lab%20Experiments/Experiment-1%20060720/actor_age.csv')
grad_data = pd.read_csv('https://raw.githubusercontent.com/kopalsharma19/J045-ML-Sem-V/master/Lab%20Experiments/Experiment-1%20060720/grad_data.csv')
ratings = pd.read_csv('https://raw.githubusercontent.com/kopalsharma19/J045-ML-Sem-V/master/Lab%20Experiments/Experiment-1%20060720/ratings.csv')<jupyter_output><empty_output><jupyter_text>**Question 1**What are the categorical variables in depression dataset?<jupyter_code>depression.head(10), depression.dtypes<jupyter_output><empty_output><jupyter_text>The categorical Variables in depression dataset are-1. Hospt2. Treat3. Outcome4. Gender  **QUESTION 2**What are the quantitative variables in depression dataset?<jupyter_code>depression.head(10), depression.dtypes<jupyter_output><empty_output><jupyter_text>Quantitative variables in depression dataset are-1. Time2. AcuteT3. Age  **QUESTION 3**Describe the distribution of the variable "friends" in dataset - Survey that asked 1,200 U.S. college students about their body perception<jupyter_code>print("Datatype\n", friends.dtypes)
print("\n")
print("Shape of Dataset - ", friends.shape)

friends.Friends.value_counts()

friends.Friends.value_counts().plot(kind='pie')<jupyter_output><empty_output><jupyter_text>**QUESTION 4**Describe the distribution of the ages of the Best Actor Oscar winners. Be sure to address shape, center, spread and outliers (Dataset - Best Actor Oscar winners (1970-2013))<jupyter_code>actor_age.describe()

np.median(actor_age['Age'])

actor_age.boxplot(column='Age')

actor_age.shape

actor_age.hist(column='Age')<jupyter_output><empty_output><jupyter_text>Shape: Skewed to the right, 44 rows and 1 columnCenter (Median): 43.5Spread: The standard deviation is 9.749153Outlier: 76, there are no lower outliers  **QUESTION 5**Getting information from the output: a. How many observations are in this data set? b. What is the mean age of the actors who won the Oscar? c. What is the five-number summary of the distribution? (Dataset - Best Actor Oscar winners (1970-2013))<jupyter_code>actor_age.describe()<jupyter_output><empty_output><jupyter_text>a) No. of Observations (count)- 44b) Mean age of actors (mean)- 44.977273c) Five-number summary of distribution ismin- 29First Quartile (25%)- 38Second Quartile (Median) (50%)- 43.5Third Quartile (75%)- 50max- 76  **QUESTION 6**Get information from the five-number summary:a. Half of the actors won the Oscar before what age? b. What is the range covered by all the actors' ages? c. What is the range covered by the middle 50% of the ages? (Dataset - Best Actor Oscar winners (1970-2013))<jupyter_code>actor_age.describe()<jupyter_output><empty_output><jupyter_text>a) Half of the actors won oscar before the age of 43.5b) Range of age for all actors in 29-76c) Range covered by middle 50% of the ages- 38-50.25  **QUESTION 7**What are the standard deviations of the three rating distributions? Was your intuition correct? (Dataset - 27 students in the class were asked to rate the instructor on a number scale of 1 to 9)<jupyter_code>ratings.head(10)
ratings.describe()<jupyter_output><empty_output><jupyter_text>Standard Deviation for Class. I- 1.568929Standard Deviation for Class. II- 4.0Standard Deviation for Class. III- 2.631174No my intuition wasn't correct.   **QUESTION 8**Assume that the average rating in each of the three classes is 5 (which should be visually reasonably clear from the histograms), and recall the interpretation of the SD as a "typical" or "average" distance between the data points and their mean. Judging from the table and the histograms, which class would have the largest standard deviation, and which one would have the smallest standard deviation? Explain your reasoning (Dataset - 27 students in the class were asked to rate the instructor on a number scale of 1 to 9)<jupyter_code>ratings.head()
ratings.describe()
ratings.hist(column='Class.I')

ratings.hist(column='Class.II')

ratings.hist(column='Class.III')<jupyter_output><empty_output><jupyter_text>Seeing the tables and histogramsClass 1 has the least standard deviation as maximum values lie in the center.  Class 2 has the most standard deviation as maximum values lie at different ends of the histogram and very few in the center.<jupyter_code><jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09618350038550501, 'fraction_numerical': 0.04182729375481881, 'mean_word_length': 6.08879781420765, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '2090', 'license': 'Apache-2.0', 'n_tokens_mistral': 1796, 'n_tokens_neox': 1566, 'n_words': 515, 'path': 'Lab Experiments/Experiment-1 060720/ML_Experiment_1_060720.ipynb', 'repo_name': 'rohitsmittal7/J045-ML-Sem-V', 'size': '5188'}