{"cells":[{"metadata":{"_uuid":"25dba6ad173e02ca97638ed122c0e135dd762aae"},"cell_type":"markdown","source":"This exercise will test your ability to read a data file and understand statistics about the data.\n\nIn later exercises, you will apply techniques to filter the data, build a machine learning model, and iteratively improve your model.\n\nThe course examples use data from Melbourne. To ensure you can apply these techniques on your own, you will have to apply them to a new dataset (with house prices from Iowa).\n\nThe exercises use a \"notebook\" coding environment.  In case you are unfamiliar with notebooks, we have a [90-second intro video](https://www.youtube.com/watch?v=4C2qMnaIKL4).\n\n# Exercises\n\nRun the following cell to set up code-checking, which will verify your work as you go."},{"metadata":{"_uuid":"e109c956932faf621296fd3696a546a927558849","trusted":true},"cell_type":"code","source":"# Set up code checking\nfrom learntools.core import binder\nbinder.bind(globals())\nfrom learntools.machine_learning.ex2 import *\nprint(\"Setup Complete\")","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"96497998b0e965c488730a1388d06fdbec00ef3c"},"cell_type":"markdown","source":"## Step 1: Loading Data\nRead the Iowa data file into a Pandas DataFrame called `home_data`."},{"metadata":{"_uuid":"f9cf76f92a473f46dcf856988911993c53683e74","trusted":true},"cell_type":"code","source":"import pandas as pd\n\n# Path of the file to read\niowa_file_path = '../input/home-data-for-ml-course/train.csv'\n\n# Fill in the line below to read the file into a variable home_data\nhome_data = pd.read_csv(iowa_file_path)\n\n# Call line below with no argument to check that you've loaded the data correctly\nstep_1.check()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"3ff2d4365912d15bd8fa3be6e71ecbb020a0b85f","trusted":true},"cell_type":"code","source":"# Lines below will give you a hint or solution code\n#step_1.hint()\n#step_1.solution()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"525518da0e6905f9063986ff44d91030220e98ef"},"cell_type":"code","source":"# Lines below will give you a hint or solution code\nstep_1.hint()\n#step_1.solution()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"c0ec56429e54be5bdfd21c0992c377d689769b9a"},"cell_type":"code","source":"# Lines below will give you a hint or solution code\n#step_1.hint()\nstep_1.solution()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"b96a42ee6f9c4b0fc688da91cccd9d7048fa483c"},"cell_type":"markdown","source":"## Step 2: Review The Data\nUse the command you learned to view summary statistics of the data. Then fill in variables to answer the following questions"},{"metadata":{"_uuid":"980f2464016f7bc779b7a697310349ca17f8dc2c","trusted":true},"cell_type":"code","source":"# Print summary statistics in next line\nhome_data.describe()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"2f3bfdc896582fe543f089c2815ea6622bce2280","trusted":true},"cell_type":"code","source":"# What is the average lot size (rounded to nearest integer)?\navg_lot_size = 10517\n\n# As of today, how old is the newest home (current year - the date in which it was built)\nnewest_home_age = 8\n\n# Checks your answers\nstep_2.check()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"80afb825fd3e8fec2bea68b1ebed056433e78327","trusted":true},"cell_type":"code","source":"#step_2.hint()\n#step_2.solution()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"fe6675ebd367c5bbb607487dfd9c26929d581979"},"cell_type":"markdown","source":"## Think About Your Data\n\nThe newest house in your data isn't that new.  A few potential explanations for this:\n1. They haven't built new houses where this data was collected.\n1. The data was collected a long time ago. Houses built after the data publication wouldn't show up.\n\nIf the reason is explanation #1 above, does that affect your trust in the model you build with this data? What about if it is reason #2?\n\nHow could you dig into the data to see which explanation is more plausible?\n\nCheck out this **[discussion thread](https://www.kaggle.com/learn-forum/60581)** to see what others think or to add your ideas.\n\n## Keep Going\nMove on to **[Build a Machine Learning Model](https://www.kaggle.com/dansbecker/your-first-machine-learning-model)** with this data.\n\n---\n**[Course Home Page](https://www.kaggle.com/learn/machine-learning)**\n\n\n"}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}