<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Nursery School Dataset
Team Members
Sharan
Srikanth
Kalyan
Nursery Database was derived from a hierarchical decision model originally developed to rank applications for nursery schools. It was used during several years in 1980's when there was excessive enrollment to these schools in Ljubljana, Slovenia, and the rejected applications frequently needed an objective explanation. The final decision depended on three subproblems
Step1:  Summarizing the Dataset
1. Dimensions Of the DataSet.
We have some data and if we don't know how many features and instances our dataset has, it is of no use. So, we should find the dimensions of the dataset.
Step2:  The above displayed result shows that the dataframe has 12960 rows and 9 colums. It means that we have 9 features and 12960 instances.
2. Looking at the data
It's a very good practice to look at your data before you proceed. We can look how our data is structured
Step3:  3. Summary of our data
We can look at the statical summary of every feature. For example, the average of a feature, mean etc.
Step4:  If we look at the above result clearly, we can infer the following. Let us take example of the feature 'parent'
count 
Step5:  In the above summary data, we ca see that the class feature has 5 different observations.  So, we should look at the data distribution of the expected output for every instance. 
Here, as we can see, the recommended variable is very less. Almost negligible.  very_recom variable is seen in 328 observations which is not too high but enough to train our machine.
The remaining three variables are almost equally distributed. So, we are good to go
Data Vizualization
Now that we have a rough idea of our dataset, we can understand it much better by vizualising it. Data can be vizualised by either Univariate plots or Multivariate plots.
Univariate plots helps us in understanding a particular feature. 
Where as Multivariate plots helps us in understanding the relationship between different features.
1. Univariate plots
Now we will start with univariate plots to understand each feature in our dataset. Run the cell below to get the same information.
<ASSISTANT_TASK:>
Python Code:
# Importing the libraries which we need now.
import pandas
from pandas.plotting import scatter_matrix
import matplotlib.pyplot as plt
%matplotlib inline
# Dataset from - https://archive.ics.uci.edu/ml/datasets/Nursery
df = pandas.read_table('nursery.txt', sep=',', header=None, names=['parents', 'has_nurs', 'form', 'children','housing',
                                                                   'finance','social','health','class'])
Explanation: Nursery School Dataset
Team Members
Sharan
Srikanth
Kalyan
Nursery Database was derived from a hierarchical decision model originally developed to rank applications for nursery schools. It was used during several years in 1980's when there was excessive enrollment to these schools in Ljubljana, Slovenia, and the rejected applications frequently needed an objective explanation. The final decision depended on three subproblems: occupation of parents and child's nursery, family structure and financial standing, and social and health picture of the family. The model was developed within expert system shell for decision making DEX
Now We will read the data and load it into a dataframe in python.
End of explanation
# shape attribute gives the dimensions of a dataframe
print df.shape
Explanation: Summarizing the Dataset
1. Dimensions Of the DataSet.
We have some data and if we don't know how many features and instances our dataset has, it is of no use. So, we should find the dimensions of the dataset.
End of explanation
# Output printing out first 5 columns
df.head()
Explanation: The above displayed result shows that the dataframe has 12960 rows and 9 colums. It means that we have 9 features and 12960 instances.
2. Looking at the data
It's a very good practice to look at your data before you proceed. We can look how our data is structured
End of explanation
# The describe function prints the summary of the data
print(df.describe())
Explanation: 3. Summary of our data
We can look at the statical summary of every feature. For example, the average of a feature, mean etc.
End of explanation
# The group by function summarizes a particular feature.
print(df.groupby('class').size())
print("\n")
print(df.groupby('parents').size())
print("\n")
print(df.groupby('has_nurs').size())
print("\n")
print(df.groupby('form').size())
print("\n")
print(df.groupby('children').size())
print("\n")
print(df.groupby('housing').size())
print("\n")
print(df.groupby('finance').size())
print("\n")
print(df.groupby('social').size())
print("\n")
print(df.groupby('health').size())
Explanation: If we look at the above result clearly, we can infer the following. Let us take example of the feature 'parent'
count : 12960  (It gives the number of instances of that feature. Here all features have same count. So, we can infer that there         are no missing values.)
unique : 3     (This number says that there 3 different categories of feature parent.)
top : usual    (This gives the category which occured the highest number of times in a feature)
freq : 4320    (This gives the frequency of the top occurence category in that feature.)
4. Class distribution
We can find out how the data is distributed. Because sometimes we might get some data which may be skewed. This leads to unexpected behaviour of our prediction model.
End of explanation
plt.rcParams['figure.figsize'] = (5,5)
df['parents'].value_counts().plot(kind='bar')
plt.title('Parents')
plt.show()
df['has_nurs'].value_counts().plot(kind='bar')
plt.title('has_nurs')
plt.show()
df['form'].value_counts().plot(kind='bar')
plt.title('Form')
plt.show()
df['children'].value_counts().plot(kind='bar')
plt.title('Children')
plt.show()
df['housing'].value_counts().plot(kind='bar')
plt.title('Housing')
plt.show()
df['finance'].value_counts().plot(kind='bar')
plt.title('Finance')
plt.show()
df['social'].value_counts().plot(kind='bar')
plt.title('Social')
plt.show()
df['health'].value_counts().plot(kind='bar')
plt.title('Health')
plt.show()
df['class'].value_counts().plot(kind='bar')
plt.title('Class')
plt.show()
Explanation: In the above summary data, we ca see that the class feature has 5 different observations.  So, we should look at the data distribution of the expected output for every instance. 
Here, as we can see, the recommended variable is very less. Almost negligible.  very_recom variable is seen in 328 observations which is not too high but enough to train our machine.
The remaining three variables are almost equally distributed. So, we are good to go
Data Vizualization
Now that we have a rough idea of our dataset, we can understand it much better by vizualising it. Data can be vizualised by either Univariate plots or Multivariate plots.
Univariate plots helps us in understanding a particular feature. 
Where as Multivariate plots helps us in understanding the relationship between different features.
1. Univariate plots
Now we will start with univariate plots to understand each feature in our dataset. Run the cell below to get the same information.
End of explanation
<END_TASK>