Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 18 #54

Merged
merged 25 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3f5be09
add config.py and read_data_from_file.py
Mar 9, 2021
ed63666
finalize dump_data_to_file
Mar 10, 2021
4b0a640
update cli args
Mar 12, 2021
254f410
add capability to export raw data to file when additional parameters …
Mar 12, 2021
9cb24ee
successfully replicate behavior of SpecDetails, handle duplicate spec…
Mar 15, 2021
ec28776
significant refactors + add fill transitions functionality
Mar 16, 2021
d78e497
create v2 based on new ServerSpecDetails class and refactored PhoneVi…
Mar 17, 2021
06b8185
finish script refactor, create general structure for dumping based on…
Mar 18, 2021
6b909cf
move read_until_done to spec_details
Mar 19, 2021
ffa5d27
add FileSpecDetails, configure proper output from PhoneView map
Mar 19, 2021
c0eb143
Add simple unit test with a mocking example
shankari Mar 22, 2021
e8c9fe0
add in code review changes aside from read_until_done
Mar 22, 2021
5746c99
Merge pull request #10 from MobilityNet/add_simple_unit_test
Mar 22, 2021
80c8638
add documentation to parser for dump_data_to_file
Mar 22, 2021
9a7ff44
fix PhoneView to use time series keys from emission
Mar 23, 2021
1821b87
mostly working FileSpecDetails, constants added to PhoneView
Mar 24, 2021
bee4c2a
fully working FileSpecDetails
Mar 25, 2021
1252e2d
updated notebooks + incorporated changes on PR
Mar 26, 2021
24832dc
Restore full tree display
shankari Mar 26, 2021
e942ab8
remove outputs from Evaluations_power_boxplots
Mar 29, 2021
0cf5836
Merge branch 'issue18' of https://github.com/singhish/mobilitynet-ana…
Mar 29, 2021
46c67c8
revert _master notebooks
Mar 29, 2021
e2d72f8
remove .DS_Store
Mar 29, 2021
550ea7a
remove .DS_Store from subfolders
Mar 29, 2021
fb7007d
Add quotes around the `DATASTORE_LOC` as well
shankari Mar 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
30 changes: 25 additions & 5 deletions Data_exploration_template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@
"import importlib"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import arrow"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -89,9 +98,17 @@
"metadata": {},
"outputs": [],
"source": [
"DATASTORE_URL = \"http://cardshark.cs.berkeley.edu\"\n",
"AUTHOR_EMAIL = \"[email protected]\"\n",
"sd = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
"\n",
"# If using ServerSpecDetails, data can alternatively be retrieved as such:\n",
"# DATASTORE_LOC = http://localhost:8080\n",
shankari marked this conversation as resolved.
Show resolved Hide resolved
"# sd = eisd.ServerSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")\n",
"\n",
"# You must run `cd bin/ && python dump_data_to_file.py --spec-id train_bus_ebike_mtv_ucb`\n",
"# before using this notebook!\n",
"\n",
"DATASTORE_LOC = \"bin/data/\"\n",
"sd = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
]
},
{
Expand Down Expand Up @@ -139,7 +156,7 @@
" for r in phone_detail_map[\"evaluation_ranges\"]:\n",
" print(8 * ' ', 30 * \"=\")\n",
" print(8 * ' ',r.keys())\n",
" print(8 * ' ',r[\"trip_id\"], r[\"eval_common_trip_id\"], r[\"eval_role\"], len(r[\"evaluation_trip_ranges\"]))\n",
" print(8 * ' ',r[\"trip_id\"], r[\"eval_common_trip_id\"], r[\"eval_role\"], len(r[\"evaluation_trip_ranges\"]), arrow.get(r[\"start_ts\"]))\n",
" for tr in r[\"evaluation_trip_ranges\"]:\n",
" print(12 * ' ', 30 * \"-\")\n",
" print(12 * ' ',tr[\"trip_id\"], tr.keys())\n",
Expand All @@ -160,7 +177,9 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"ev = eiev.EvaluationView()\n",
Expand Down Expand Up @@ -240,7 +259,8 @@
" print(12 * ' ', 30 * \"-\")\n",
" print(12 * ' ',tr[\"trip_id\"], tr.keys())\n",
" # I am not printing the actual trajectories since that would be too long, only displaying modes\n",
" gt_trip = sd.get_ground_truth_for_trip(tr[\"trip_id_base\"])\n",
" print(tr)\n",
" gt_trip = sd.get_ground_truth_for_trip(tr[\"trip_id_base\"], tr[\"start_ts\"], tr[\"end_ts\"])\n",
" print(12 * ' ', eisd.SpecDetails.get_concat_trajectories(gt_trip)[\"properties\"])"
]
},
Expand Down
21 changes: 7 additions & 14 deletions Evaluate_power_vs_classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
"metadata": {},
"outputs": [],
"source": [
"DATASTORE_URL = \"http://cardshark.cs.berkeley.edu\"\n",
"DATASTORE_LOC = \"bin/data/\"\n",
"AUTHOR_EMAIL = \"[email protected]\"\n",
"sd_la = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
"sd_la = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
]
},
{
Expand Down Expand Up @@ -327,8 +327,8 @@
"metadata": {},
"outputs": [],
"source": [
"r2q_map = {\"power_control\": 0, \"HAMFDC\": 1, \"MAHFDC\": 2, \"HAHFDC\": 3, \"accuracy_control\": 4}\n",
"q2r_map = {0: \"power\", 1: \"HAMFDC\", 2: \"MAHFDC\", 3: \"HAHFDC\", 4: \"accuracy\"}"
"r2q_map = {\"power_control\": 0, \"HAMFDC\": 1, \"MAHFDC\": 2, \"HAHFDC\": 3, \"MAMFDC\": 4, \"accuracy_control\": 5}\n",
"q2r_map = {0: \"power\", 1: \"HAMFDC\", 2: \"MAHFDC\", 3: \"HAHFDC\", 4: \"MAMFDC\", 5: \"accuracy\"}"
]
},
{
Expand Down Expand Up @@ -760,13 +760,6 @@
"source": [
"check_outlier(pv_la.map()['android']['ucb-sdb-android-2'][\"evaluation_ranges\"][0], 0, \"suburb_city_driving_weekend_0\", \"AUTOMOTIVE\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -785,7 +778,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.8.2"
}
},
"nbformat": 4,
Expand Down
10 changes: 5 additions & 5 deletions Evaluate_power_vs_motion_activity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@
"metadata": {},
"outputs": [],
"source": [
"DATASTORE_URL = \"http://cardshark.cs.berkeley.edu\"\n",
"DATASTORE_LOC = \"bin/data/\"\n",
"AUTHOR_EMAIL = \"[email protected]\"\n",
"sd_la = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
"sd_la = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
]
},
{
Expand Down Expand Up @@ -960,7 +960,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.8.2"
}
},
"nbformat": 4,
Expand Down
18 changes: 9 additions & 9 deletions Evaluate_power_vs_trip_start_end.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@
"metadata": {},
"outputs": [],
"source": [
"DATASTORE_URL = \"http://cardshark.cs.berkeley.edu\"\n",
"DATASTORE_LOC = \"bin/data/\"\n",
"AUTHOR_EMAIL = \"[email protected]\"\n",
"sd_la = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
"sd_la = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
]
},
{
Expand Down Expand Up @@ -323,8 +323,8 @@
"metadata": {},
"outputs": [],
"source": [
"r2q_map = {\"power_control\": 0, \"HAMFDC\": 1, \"MAHFDC\": 2, \"HAHFDC\": 3, \"accuracy_control\": 4}\n",
"q2r_map = {0: \"power\", 1: \"HAMFDC\", 2: \"MAHFDC\", 3: \"HAHFDC\", 4: \"accuracy\"}"
"r2q_map = {\"power_control\": 0, \"HAMFDC\": 1, \"MAHFDC\": 2, \"HAHFDC\": 3, \"MAMFDC\": 4, \"accuracy_control\": 5}\n",
"q2r_map = {0: \"power\", 1: \"HAMFDC\", 2: \"MAHFDC\", 3: \"HAHFDC\", 4: \"MAMFDC\", 5: \"accuracy\"}"
]
},
{
Expand Down Expand Up @@ -398,7 +398,7 @@
"metadata": {},
"outputs": [],
"source": [
"ifig, ax_array = plt.subplots(nrows=2,ncols=3,figsize=(9,6), sharex=False, sharey=True)\n",
"ifig, ax_array = plt.subplots(nrows=2,ncols=3,figsize=(16,6), sharex=False, sharey=True)\n",
"timeline_list = [\"train_bus_ebike_mtv_ucb\", \"car_scooter_brex_san_jose\", \"unimodal_trip_car_bike_mtv_la\"]\n",
"for i, tl in enumerate(timeline_list):\n",
" tradeoff_df.query(\"timeline == @tl & phone_os == 'android'\").boxplot(ax = ax_array[0][i], column=[\"count_diff\"], by=[\"quality\"])\n",
Expand Down Expand Up @@ -587,7 +587,7 @@
"metadata": {},
"outputs": [],
"source": [
"ifig, ax_array = plt.subplots(nrows=4,ncols=3,figsize=(10,10), sharex=False, sharey=True)\n",
"ifig, ax_array = plt.subplots(nrows=4,ncols=3,figsize=(16,10), sharex=False, sharey=True)\n",
"timeline_list = [\"train_bus_ebike_mtv_ucb\", \"car_scooter_brex_san_jose\", \"unimodal_trip_car_bike_mtv_la\"]\n",
"for i, tl in enumerate(timeline_list):\n",
" tradeoff_df.query(\"timeline == @tl & phone_os == 'android'\").boxplot(ax = ax_array[0][i], column=[\"start_diff_mins\"], by=[\"quality\"])\n",
Expand Down Expand Up @@ -1015,7 +1015,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.8.2"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions Evaluations_power_boxplots.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"metadata": {},
"outputs": [],
"source": [
"DATASTORE_URL = \"http://cardshark.cs.berkeley.edu\"\n",
"DATASTORE_LOC = \"bin/data/\"\n",
"AUTHOR_EMAIL = \"[email protected]\"\n",
"sd_la = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.SpecDetails(DATASTORE_URL, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
"sd_la = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"unimodal_trip_car_bike_mtv_la\")\n",
"sd_sj = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"car_scooter_brex_san_jose\")\n",
"sd_ucb = eisd.FileSpecDetails(DATASTORE_LOC, AUTHOR_EMAIL, \"train_bus_ebike_mtv_ucb\")"
]
},
{
Expand Down Expand Up @@ -135,7 +135,7 @@
"metadata": {},
"outputs": [],
"source": [
"ios_loc_entries = sd_sj.retrieve_data_from_server(\"ucb-sdb-ios-1\", [\"background/location\"],\n",
"ios_loc_entries = sd_sj.retrieve_data(\"ucb-sdb-ios-1\", [\"background/location\"],\n",
" arrow.get(\"2019-08-07T14:50:57.445000-07:00\").timestamp,\n",
" arrow.get(\"2019-08-07T15:00:16.787000-07:00\").timestamp)\n",
"ios_location_df = pd.DataFrame([e[\"data\"] for e in ios_loc_entries])"
Expand All @@ -147,7 +147,7 @@
"metadata": {},
"outputs": [],
"source": [
"android_loc_entries = sd_sj.retrieve_data_from_server(\"ucb-sdb-android-1\", [\"background/location\"],\n",
"android_loc_entries = sd_sj.retrieve_data(\"ucb-sdb-android-1\", [\"background/location\"],\n",
" arrow.get(\"2019-08-07T14:50:57.445000-07:00\").timestamp,\n",
" arrow.get(\"2019-08-07T15:00:16.787000-07:00\").timestamp)\n",
"android_location_df = pd.DataFrame([e[\"data\"] for e in android_loc_entries])"
Expand Down
Binary file added bin/.DS_Store
Binary file not shown.
Loading