<jupyter_start><jupyter_text>The median and average home values across all Boston Suburbs in dollars. July 16, 2017 <NAME> 1. Title: Boston Housing Data2. Sources:   (a) Origin:  This dataset was taken from the StatLib library which is                maintained at Carnegie Mellon University.   (b) Creator:  <NAME>. and <NAME>. 'Hedonic prices and the                  demand for clean air', J. Environ. Economics & Management,                 vol.5, 81-102, 1978.   (c) Date: July 7, 19933. Past Usage:   -   Used in Belsley, Kuh & Welsch, 'Regression diagnostics ...', Wiley,        1980.   N.B. Various transformations are used in the table on       pages 244-261.    -  Quinlan,R. (1993). Combining Instance-Based and Model-Based Learning.       In Proceedings on the Tenth International Conference of Machine        Learning, 236-243, University of Massachusetts, Amherst. Morgan       Kaufmann.4. Relevant Information:   Concerns housing values in suburbs of Boston.5. Number of Instances: 5066. Number of Attributes: 13 continuous attributes (including "class"                         attribute "MEDV"), 1 binary-valued attribute.7. Attribute Information:    1. CRIM      per capita crime rate by town    2. ZN        proportion of residential land zoned for lots over                  25,000 sq.ft.    3. INDUS     proportion of non-retail business acres per town    4. CHAS      Charles River dummy variable (= 1 if tract bounds                  river; 0 otherwise)    5. NOX       nitric oxides concentration (parts per 10 million)    6. RM        average number of rooms per dwelling    7. AGE       proportion of owner-occupied units built prior to 1940    8. DIS       weighted distances to five Boston employment centres    9. RAD       index of accessibility to radial highways    10. TAX      full-value property-tax rate per $10,000    11. PTRATIO  pupil-teacher ratio by town    12. B        1000(Bk - 0.63)^2 where Bk is the proportion of blacks                  by town    13. LSTAT    % lower status of the population    14. MEDV     Median value of owner-occupied homes in $1000's8. Missing Attribute Values:  None.sourced from University of California Irvine - Machine Learning Repositoryhttps://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.names. Analyze Data Set:CSV Data sourced from University of California Irvine - Machine Learning Repositoryhttps://archive.ics.uci.edu/ml/datasets/Housing<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import pandas as pd
housing_data = pd.read_csv('boston_housing_data.csv', delimiter="\s+", names=('CRIM', 'ZN', 'INDUS', 'CHAS', 'NOX', 'RM', 'AGE', 'DIS', 'RAD', 'TAX', 'PTRATIO', 'B', 'LSTAT', 'MEDV'))
housing_data<jupyter_output><empty_output><jupyter_text>The median and average home values across all Boston Suburbs in dollars.<jupyter_code>data_frame = pd.DataFrame(housing_data)
'Median value of all homes in $1000\'s is ${:0.2f}'.format(data_frame['MEDV'].median() * 1000)
'Mean value of all homes in $1000\'s is ${:0.2f}'.format(data_frame['MEDV'].mean() * 1000)<jupyter_output><empty_output><jupyter_text>The median home value of the suburb with the newest houses.<jupyter_code>newest = housing_data.loc[housing_data['AGE'].idxmin()]
'Median value of newest homes in $1000\'s is ${:0.2f}'.format(newest['MEDV']*1000)<jupyter_output><empty_output><jupyter_text>The relationship between per-capita crime rate and the pupil-teacher ratio. Differentiate between whether or not the suburb is bounded by the Charles River.<jupyter_code>bound = housing_data[housing_data['CHAS']==1].filter(['CRIM', 'PTRATIO'])
unbound = housing_data[housing_data['CHAS']==0].filter(['CRIM', 'PTRATIO'])
plt.scatter(
    unbound['PTRATIO'], 
    unbound['CRIM'],
    c='red', 
    label='Suburb not on the Charles River'
)
plt.scatter(
    bound['PTRATIO'],
    bound['CRIM'],
    c='blue', 
    label='Suburbs on Charles River'
)
plt.xlabel('Pupil to Teacher ratio') 
plt.ylabel('Crime Rate per Capita (%)') 
plt.title('Crime rate versus pupil to teacher ratio, bounded by Charles River')
plt.legend(loc='upper left')
plt.show()<jupyter_output><empty_output><jupyter_text>The relationship between the proportion of black citizens and the distance to employment centers in Boston.<jupyter_code>BK = (housing_data.B / (1000**(1/2))) + 0.63
plt.scatter(housing_data['DIS'], BK)
plt.xlabel('Weighted distance to employment center')
plt.ylabel('Proportion of Black people (%)')
plt.title("Relation of black citizens and distance to employment centers")
plt.show()<jupyter_output><empty_output><jupyter_text>The relationship between median value of owner-occuped homes and nitric oxide concentration along with median home value and the proportion of non-retail business (on the same plot).<jupyter_code>plt.scatter(housing_data['MEDV'], housing_data['NOX'], c='blue', label='Nitric Oxides')
plt.scatter(housing_data['MEDV'], housing_data['INDUS'], c='red', label='Non-Retail Business')
plt.xlabel('Median value of homes')
plt.ylabel('Nitric Oxides Concentration Proportion of Non-Retail Business')
plt.legend(loc='upper right')
plt.title("N.O.X. concentration proportion of Non-Retail Business")
plt.show()<jupyter_output><empty_output><jupyter_text>The relationship between per capita crime rate and median value of homes.<jupyter_code>plt.scatter(housing_data['MEDV'], housing_data['CRIM'], c='red', label='Non-Retail Business')
plt.xlabel('Median value of homes')
plt.ylabel('Crime Per Capita')
plt.legend(loc='upper right')
plt.title("Median value of homes in relation to Crime Rate per Capita")
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1105225988700565, 'fraction_numerical': 0.025600282485875706, 'mean_word_length': 4.255102040816326, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 2, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '490149', 'license': 'MIT', 'n_tokens_mistral': 1868, 'n_tokens_neox': 1671, 'n_words': 573, 'path': 'analyze_data_set.ipynb', 'repo_name': 'ADL175/machine-learning', 'size': '5680'}