{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/misikoff/opt/anaconda3/envs/sta663/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] } ], "source": [ "# !pip install datasets\n", "\n", "from datasets import load_dataset" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Downloading builder script: 100%|██████████| 18.5k/18.5k [00:00<00:00, 11.3MB/s]\n", "Downloading data: 100%|██████████| 20.4M/20.4M [00:00<00:00, 33.6MB/s]\n", "Generating train split: 96012 examples [00:02, 46188.04 examples/s]\n", "Generating validation split: 96012 examples [00:02, 47013.79 examples/s]\n", "Generating test split: 96012 examples [00:02, 46947.45 examples/s]\n" ] } ], "source": [ "configs = [\"home_value_forecasts\", \"new_constructions\", \"for_sale_listings\", \"rentals\"]\n", "\n", "dataset = load_dataset(\"misikoff/zillow\", \"rentals\", trust_remote_code=True)" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Region ID': '102001',\n", " 'Size Rank': 0,\n", " 'Region': 'United States',\n", " 'Region Type': 'country',\n", " 'State': None,\n", " 'Home Type': 'SFR',\n", " 'Date': '2018-01-31',\n", " 'Sale Price': 309000.0,\n", " 'Sale Price per Sqft': 137.41232299804688,\n", " 'Count': 33940}" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(iter((dataset[\"train\"])))" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "gen = iter((dataset[\"train\"]))" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Region ID': '102001',\n", " 'Size Rank': 0,\n", " 'Region': 'United States',\n", " 'Region Type': 'country',\n", " 'State': None,\n", " 'Home Type': 'condo/co-op only',\n", " 'Date': '2018-03-31',\n", " 'Sale Price': 386700.0,\n", " 'Sale Price per Sqft': 238.31776428222656,\n", " 'Count': 4267}" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "next(gen)" ] } ], "metadata": { "kernelspec": { "display_name": "sta663", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 2 }