diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e23f78..17535b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,13 +9,13 @@ repos: - id: trailing-whitespace - repo: https://github.com/kynan/nbstripout - rev: 0.6.1 + rev: 0.7.1 hooks: - id: nbstripout - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.1.11 + rev: v0.2.2 hooks: # Run the linter. - id: ruff diff --git a/docs/walkthrough/encoding.ipynb b/docs/walkthrough/encoding.ipynb index b1359a0..4c9786d 100644 --- a/docs/walkthrough/encoding.ipynb +++ b/docs/walkthrough/encoding.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7998b969", + "id": "0", "metadata": {}, "source": [ "# Data Encoding\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f17c8818", + "id": "1", "metadata": { "tags": [ "remove-cell" @@ -30,7 +30,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4e7246c", + "id": "2", "metadata": { "tags": [] }, @@ -48,7 +48,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f409525", + "id": "3", "metadata": { "tags": [ "remove-cell" @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "6085397c", + "id": "4", "metadata": {}, "source": [ "## Example Data\n", @@ -78,7 +78,7 @@ }, { "cell_type": "markdown", - "id": "077d2d46", + "id": "5", "metadata": {}, "source": [ "We'll load them as a multi-dimensional `xarray.Dataset` — or, more exactly, a \n", @@ -89,7 +89,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b087c457", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -99,7 +99,7 @@ }, { "cell_type": "markdown", - "id": "6dc7148c", + "id": "7", "metadata": {}, "source": [ "Because sharrow uses the `xarray.Dataset` format to work with data, individual \n", @@ -113,7 +113,7 @@ }, { "cell_type": "markdown", - "id": "f17a0eef", + "id": "8", "metadata": {}, "source": [ "## Fixed Point Encoding\n", @@ -144,7 +144,7 @@ { "cell_type": "code", "execution_count": null, - "id": "559dfa0a", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "65e3948e", + "id": "10", "metadata": {}, "source": [ "The distance data in the skims is a great candidate for fixed point\n", @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": null, - "id": "729aeb05", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -172,7 +172,7 @@ }, { "cell_type": "markdown", - "id": "3142285a", + "id": "12", "metadata": {}, "source": [ "The data are all small(ish) values with two decimal point fixed\n", @@ -184,7 +184,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93163d29", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -193,7 +193,7 @@ }, { "cell_type": "markdown", - "id": "ec58a25f", + "id": "14", "metadata": {}, "source": [ "That's a really small range because this is only test data. But even \n", @@ -207,7 +207,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2a6b5b44", + "id": "15", "metadata": {}, "outputs": [], "source": [ @@ -218,7 +218,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2ad591bb", + "id": "16", "metadata": { "tags": [ "remove-cell" @@ -241,7 +241,7 @@ }, { "cell_type": "markdown", - "id": "17dadf8f", + "id": "17", "metadata": {}, "source": [ "We can apply that function for any number of variables in the skims, and\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "50401375", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -260,7 +260,7 @@ }, { "cell_type": "markdown", - "id": "03ef433c", + "id": "19", "metadata": {}, "source": [ "To manage the digital encodings across an entire dataset, sharrow implements\n", @@ -271,7 +271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5e73b78f", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -282,7 +282,7 @@ }, { "cell_type": "markdown", - "id": "7ebda187", + "id": "21", "metadata": {}, "source": [ "And you can review the encodings for every variable in the dataset like this:" @@ -291,7 +291,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d5eb8600", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bd549b5e", + "id": "23", "metadata": { "tags": [ "remove-cell" @@ -319,7 +319,7 @@ }, { "cell_type": "markdown", - "id": "0ba5279d", + "id": "24", "metadata": {}, "source": [ "To demonstrate that the encoding works transparently with a `Flow`,\n", @@ -332,7 +332,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f4f21165", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -352,7 +352,7 @@ }, { "cell_type": "markdown", - "id": "45073351", + "id": "26", "metadata": {}, "source": [ "We can do the same for the encoded skims, and we get exactly the\n", @@ -362,7 +362,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a4293f7", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -382,7 +382,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7d74e53e", + "id": "28", "metadata": { "tags": [ "remove-cell" @@ -396,7 +396,7 @@ }, { "cell_type": "markdown", - "id": "d743105b", + "id": "29", "metadata": {}, "source": [ "## Dictionary Encoding\n", @@ -423,7 +423,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eea40e35", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -432,7 +432,7 @@ }, { "cell_type": "markdown", - "id": "81c246a9", + "id": "31", "metadata": {}, "source": [ "We can see various fares applied at different time periods if we\n", @@ -442,7 +442,7 @@ { "cell_type": "code", "execution_count": null, - "id": "83ffccc3", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -451,7 +451,7 @@ }, { "cell_type": "markdown", - "id": "ed5018ff", + "id": "33", "metadata": {}, "source": [ "Once encoded, the array itself only contains offset pointers (small integers),\n", @@ -461,7 +461,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bbac55dd", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -472,7 +472,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48eed254", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -482,7 +482,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a016d30f", + "id": "36", "metadata": { "tags": [ "remove-cell" @@ -510,7 +510,7 @@ }, { "cell_type": "markdown", - "id": "e198cbae", + "id": "37", "metadata": {}, "source": [ "If we want to recover the original data for analysis (other than in\n", @@ -520,7 +520,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15098a9c", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -530,7 +530,7 @@ { "cell_type": "code", "execution_count": null, - "id": "28afb335", + "id": "39", "metadata": { "tags": [ "remove-cell" @@ -544,7 +544,7 @@ }, { "cell_type": "markdown", - "id": "b1220858", + "id": "40", "metadata": {}, "source": [ "## Joint Dict Encoding\n", @@ -562,7 +562,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ed2ae464", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -581,7 +581,7 @@ }, { "cell_type": "markdown", - "id": "e4bbace5", + "id": "42", "metadata": {}, "source": [ "A unique name is automatically generated for the join when `joint_dict` is set\n", @@ -594,7 +594,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5f8523e3", + "id": "43", "metadata": {}, "outputs": [], "source": [ @@ -606,7 +606,7 @@ }, { "cell_type": "markdown", - "id": "b790aadb", + "id": "44", "metadata": {}, "source": [ "The resulting dataset adds a variable for each created group, which contains \n", @@ -617,7 +617,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a29e7dd", + "id": "45", "metadata": {}, "outputs": [], "source": [ @@ -626,7 +626,7 @@ }, { "cell_type": "markdown", - "id": "c5fe8050", + "id": "46", "metadata": {}, "source": [ "Skims encoded in this manner can be fed into sharrow and will compile and return \n", @@ -640,7 +640,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2f539487", + "id": "47", "metadata": {}, "outputs": [], "source": [ @@ -674,7 +674,7 @@ { "cell_type": "code", "execution_count": null, - "id": "442cbcb5", + "id": "48", "metadata": {}, "outputs": [], "source": [ @@ -750,7 +750,7 @@ { "cell_type": "code", "execution_count": null, - "id": "30581a47", + "id": "49", "metadata": {}, "outputs": [], "source": [ @@ -766,7 +766,7 @@ }, { "cell_type": "markdown", - "id": "cb219dc3-dd66-44cd-a7c5-2a1da4bc1467", + "id": "50", "metadata": { "tags": [] }, @@ -784,7 +784,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3b765919-69a4-4fb0-b805-9d3b5fed7897", + "id": "51", "metadata": { "tags": [] }, @@ -801,7 +801,7 @@ { "cell_type": "code", "execution_count": null, - "id": "312faa0b-13cf-4649-9835-7a53b5e81a0b", + "id": "52", "metadata": { "tags": [] }, @@ -812,7 +812,7 @@ }, { "cell_type": "markdown", - "id": "c51a88d2-02b1-4502-9f4b-271fbb126699", + "id": "53", "metadata": {}, "source": [ "We'll then create a Dataset using construct." @@ -821,7 +821,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cd1c2fd5-59c6-48cb-bd6e-d2f9dde2aa36", + "id": "54", "metadata": { "tags": [] }, @@ -833,7 +833,7 @@ }, { "cell_type": "markdown", - "id": "033b3629-a16b-47a4-bb18-10af9c7c4f07", + "id": "55", "metadata": {}, "source": [ "Note that the \"income\" variable remains an integer as expected, but the \"income_grp\" variable, \n", @@ -846,7 +846,7 @@ { "cell_type": "code", "execution_count": null, - "id": "369442af-1c69-41eb-b530-ea398d6eac7a", + "id": "56", "metadata": { "tags": [] }, @@ -858,7 +858,7 @@ { "cell_type": "code", "execution_count": null, - "id": "58db6505-1c90-475e-8d91-0e2e89ec0f0e", + "id": "57", "metadata": { "tags": [] }, @@ -876,7 +876,7 @@ }, { "cell_type": "markdown", - "id": "38f8a6c9-4bca-4e73-82b0-e0996814565a", + "id": "58", "metadata": {}, "source": [ "If you try to make the return trip to a pandas DataFrame using the regular \n", @@ -887,7 +887,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ad2f8677-b02c-4d28-892f-3272804bf714", + "id": "59", "metadata": { "tags": [] }, @@ -898,7 +898,7 @@ }, { "cell_type": "markdown", - "id": "95f26992-241f-4982-aa56-f1055a35f969", + "id": "60", "metadata": {}, "source": [ "But, if you use the `single_dim` accessor on the dataset provided by sharrow,\n", @@ -908,7 +908,7 @@ { "cell_type": "code", "execution_count": null, - "id": "43b94637-c025-4578-9e97-4b6484cb231e", + "id": "61", "metadata": { "tags": [] }, @@ -920,7 +920,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1b86a4b-c19f-4ae9-8a8b-395f53209bc6", + "id": "62", "metadata": { "tags": [] }, @@ -932,7 +932,7 @@ }, { "cell_type": "markdown", - "id": "5e66c294-747d-414c-8e03-b8b551a0e2a9", + "id": "63", "metadata": {}, "source": [ "Note that this automatic handling of categorical data only applies when constructing\n", @@ -944,7 +944,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2208108a-d051-4941-ad72-b89a05169d81", + "id": "64", "metadata": { "tags": [] }, diff --git a/docs/walkthrough/one-dim.ipynb b/docs/walkthrough/one-dim.ipynb index 9f79540..8f2091d 100644 --- a/docs/walkthrough/one-dim.ipynb +++ b/docs/walkthrough/one-dim.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7998b969", + "id": "0", "metadata": {}, "source": [ "# Sharrow Basics\n", @@ -13,7 +13,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4e7246c", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -32,7 +32,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f409525", + "id": "2", "metadata": { "tags": [ "remove-cell" @@ -48,7 +48,7 @@ }, { "cell_type": "markdown", - "id": "6085397c", + "id": "3", "metadata": {}, "source": [ "## Example Data\n", @@ -66,7 +66,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56f4bb4d", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -77,7 +77,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a369bd3", + "id": "5", "metadata": { "tags": [ "remove-cell" @@ -94,7 +94,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f2db078", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -105,7 +105,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56ef0b92", + "id": "7", "metadata": { "tags": [ "remove-cell" @@ -120,7 +120,7 @@ }, { "cell_type": "markdown", - "id": "077d2d46", + "id": "8", "metadata": {}, "source": [ "The skims, on the other hand, are not just simple tabular data, but rather a \n", @@ -132,7 +132,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b087c457", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -142,7 +142,7 @@ }, { "cell_type": "markdown", - "id": "4aa72ea5", + "id": "10", "metadata": {}, "source": [ "For tabular data, sharrow can be provided either pandas DataFrames or xarray Datasets, \n", @@ -153,7 +153,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e5d0b407", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -162,7 +162,7 @@ }, { "cell_type": "markdown", - "id": "da3d254a", + "id": "12", "metadata": {}, "source": [ "Suppose we're wanting to simulate a tour mode choice. Normally we'd probably have\n", @@ -175,7 +175,7 @@ { "cell_type": "code", "execution_count": null, - "id": "118af761", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0aaa20b5", + "id": "14", "metadata": { "tags": [ "remove-cell" @@ -214,7 +214,7 @@ }, { "cell_type": "markdown", - "id": "911c1fcf", + "id": "15", "metadata": {}, "source": [ "Of note in this table, we include include destination TAZ's by index (position) not \n", @@ -223,7 +223,7 @@ }, { "cell_type": "markdown", - "id": "ee1cda9d", + "id": "16", "metadata": {}, "source": [ "## Spec Files" @@ -231,7 +231,7 @@ }, { "cell_type": "markdown", - "id": "8f4c3467", + "id": "17", "metadata": {}, "source": [ "Now that we've got our tours to work with, we'll also need \n", @@ -247,7 +247,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4236e25d", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -263,7 +263,7 @@ }, { "cell_type": "markdown", - "id": "c245373d", + "id": "19", "metadata": {}, "source": [ "We'll use pandas to load these values into a DataFrame." @@ -272,7 +272,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69b49c49", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -283,7 +283,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9bd68402", + "id": "21", "metadata": { "tags": [ "remove-cell" @@ -298,7 +298,7 @@ }, { "cell_type": "markdown", - "id": "8add2a36", + "id": "22", "metadata": {}, "source": [ "## Data Trees and Flows\n", @@ -312,7 +312,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ab4a2e92", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -350,7 +350,7 @@ }, { "cell_type": "markdown", - "id": "77ac0779", + "id": "24", "metadata": {}, "source": [ "The first named dataset we include, `tour`, is by default the root node of this data tree.\n", @@ -391,7 +391,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a860a197", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -400,7 +400,7 @@ }, { "cell_type": "markdown", - "id": "5ea77fad", + "id": "26", "metadata": {}, "source": [ "To use a `Flow` for preparing the array of data that backs the utility\n", @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5607980e", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -425,7 +425,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eafff212", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -435,7 +435,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bdef334f", + "id": "29", "metadata": { "tags": [ "remove-cell" @@ -469,7 +469,7 @@ }, { "cell_type": "markdown", - "id": "558482f0", + "id": "30", "metadata": {}, "source": [ "Subsequent calls to `load()` are much faster." @@ -478,7 +478,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a84c4ef2", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -488,7 +488,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b5773c5c", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -504,7 +504,7 @@ }, { "cell_type": "markdown", - "id": "f461d972", + "id": "33", "metadata": {}, "source": [ "It's not faster because it's cached the data, but because it's cached the compiled code.\n", @@ -517,7 +517,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c445e68b", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -527,7 +527,7 @@ }, { "cell_type": "markdown", - "id": "3afd1597", + "id": "35", "metadata": {}, "source": [ "Note that the flow requires not just a base dataset but a whole DataTree to operate,\n", @@ -541,7 +541,7 @@ { "cell_type": "code", "execution_count": null, - "id": "17e178b9", + "id": "36", "metadata": {}, "outputs": [], "source": [ @@ -551,7 +551,7 @@ { "cell_type": "code", "execution_count": null, - "id": "509aa5b1", + "id": "37", "metadata": {}, "outputs": [], "source": [ @@ -565,7 +565,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2bdc918a", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -575,7 +575,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa37a5a1", + "id": "39", "metadata": {}, "outputs": [], "source": [ @@ -606,7 +606,7 @@ }, { "cell_type": "markdown", - "id": "a78a1be9", + "id": "40", "metadata": {}, "source": [ "The load function also has some other features, like nicely formatting the output\n", @@ -616,7 +616,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9faf1ce0", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -627,7 +627,7 @@ { "cell_type": "code", "execution_count": null, - "id": "15ff5806", + "id": "42", "metadata": { "tags": [ "remove-cell" @@ -657,7 +657,7 @@ }, { "cell_type": "markdown", - "id": "92b552d0", + "id": "43", "metadata": {}, "source": [ "## Linear-in-Parameters Functions\n", @@ -672,7 +672,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a4cdbe1", + "id": "44", "metadata": {}, "outputs": [], "source": [ @@ -683,7 +683,7 @@ }, { "cell_type": "markdown", - "id": "f783f218", + "id": "45", "metadata": {}, "source": [ "But `sharrow` provides a substantially faster option, by embedding\n", @@ -694,7 +694,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dfc9c75", + "id": "46", "metadata": {}, "outputs": [], "source": [ @@ -704,7 +704,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5776822fb0889df", + "id": "47", "metadata": {}, "outputs": [], "source": [ @@ -715,7 +715,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c5afc8e3", + "id": "48", "metadata": { "tags": [ "remove-cell" @@ -729,7 +729,7 @@ }, { "cell_type": "markdown", - "id": "3eb5791b", + "id": "49", "metadata": {}, "source": [ "As before, the compiler runs only the first time we apply the this \n", @@ -740,7 +740,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1ae41e6b", + "id": "50", "metadata": {}, "outputs": [], "source": [ @@ -749,7 +749,7 @@ }, { "cell_type": "markdown", - "id": "089e16b3", + "id": "51", "metadata": {}, "source": [ "As for the plain `load` method, the `dot` method also has some formatted output versions.\n", @@ -759,7 +759,7 @@ { "cell_type": "code", "execution_count": null, - "id": "869c2b1d", + "id": "52", "metadata": {}, "outputs": [], "source": [ @@ -768,7 +768,7 @@ }, { "cell_type": "markdown", - "id": "13a8f94c", + "id": "53", "metadata": {}, "source": [ "This works even better if the coefficients are given as a DataArray too, so it \n", @@ -778,7 +778,7 @@ { "cell_type": "code", "execution_count": null, - "id": "53b9871c", + "id": "54", "metadata": {}, "outputs": [], "source": [ @@ -790,7 +790,7 @@ }, { "cell_type": "markdown", - "id": "40c0e441", + "id": "55", "metadata": {}, "source": [ "## Multinomial Logit Simulation\n", @@ -806,7 +806,7 @@ { "cell_type": "code", "execution_count": null, - "id": "12bd943d", + "id": "56", "metadata": {}, "outputs": [], "source": [ @@ -815,7 +815,7 @@ }, { "cell_type": "markdown", - "id": "0beb2c18", + "id": "57", "metadata": {}, "source": [ "Given those draws, we use the `logit_draws` method to build and apply a \n", @@ -826,7 +826,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d54d71021951470b", + "id": "58", "metadata": {}, "outputs": [], "source": [ @@ -836,7 +836,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7a42d221", + "id": "59", "metadata": {}, "outputs": [], "source": [ @@ -845,7 +845,7 @@ }, { "cell_type": "markdown", - "id": "9bcf244e", + "id": "60", "metadata": {}, "source": [ "As this is the most complex flow processor,\n", @@ -857,7 +857,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eec9ebd14ff646eb", + "id": "61", "metadata": {}, "outputs": [], "source": [ @@ -867,7 +867,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1b4f8e37", + "id": "62", "metadata": {}, "outputs": [], "source": [ @@ -876,7 +876,7 @@ }, { "cell_type": "markdown", - "id": "2fd05c66", + "id": "63", "metadata": {}, "source": [ "The resulting choices are the index position of the choices, not the labels." @@ -885,7 +885,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d371e6cc", + "id": "64", "metadata": {}, "outputs": [], "source": [ @@ -894,7 +894,7 @@ }, { "cell_type": "markdown", - "id": "683ef19d", + "id": "65", "metadata": {}, "source": [ "But if we want the labels, it's easy enough to convert these indexes into labels." @@ -903,7 +903,7 @@ { "cell_type": "code", "execution_count": null, - "id": "464e87c5", + "id": "66", "metadata": {}, "outputs": [], "source": [ @@ -913,7 +913,7 @@ { "cell_type": "code", "execution_count": null, - "id": "69618e5c", + "id": "67", "metadata": { "tags": [ "remove-cell" @@ -933,7 +933,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2d8be259", + "id": "68", "metadata": {}, "outputs": [], "source": [ @@ -947,7 +947,7 @@ }, { "cell_type": "markdown", - "id": "bf8445d5", + "id": "69", "metadata": {}, "source": [ "## Nested Logit Simulation\n", @@ -963,7 +963,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8b830bf6", + "id": "70", "metadata": {}, "outputs": [], "source": [ @@ -993,7 +993,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fb9f17cc", + "id": "71", "metadata": { "tags": [ "raises-exception" @@ -1006,7 +1006,7 @@ }, { "cell_type": "markdown", - "id": "dfc1a442", + "id": "72", "metadata": {}, "source": [ "Once the nesting tree is defined, it needs to be converted to operating arrays, using the `as_arrays` method (available in larch 5.7.1 and later). Since we note estimating a nested logit model and just applying one,\n", @@ -1016,7 +1016,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b04d439", + "id": "73", "metadata": {}, "outputs": [], "source": [ @@ -1027,7 +1027,7 @@ }, { "cell_type": "markdown", - "id": "accbae24", + "id": "74", "metadata": {}, "source": [ "This dictionary of arrays can be passed in to the `logit_draws` function to compile a nested logit model\n", @@ -1037,7 +1037,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c9369f69", + "id": "75", "metadata": {}, "outputs": [], "source": [ @@ -1047,7 +1047,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5c53c918", + "id": "76", "metadata": {}, "outputs": [], "source": [ @@ -1057,7 +1057,7 @@ { "cell_type": "code", "execution_count": null, - "id": "abfa83a1", + "id": "77", "metadata": {}, "outputs": [], "source": [ @@ -1074,7 +1074,7 @@ { "cell_type": "code", "execution_count": null, - "id": "698f9211", + "id": "78", "metadata": {}, "outputs": [], "source": [ @@ -1092,7 +1092,7 @@ }, { "cell_type": "markdown", - "id": "da30839b", + "id": "79", "metadata": {}, "source": [ "For nested logit models, computing just the logsums is faster than generating probabilities (and making choices) so the `logsums=1` argument allows you to short-circuit the computations if you only want the logsums." @@ -1101,7 +1101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0545ad8b", + "id": "80", "metadata": {}, "outputs": [], "source": [ @@ -1111,7 +1111,7 @@ { "cell_type": "code", "execution_count": null, - "id": "85071783", + "id": "81", "metadata": {}, "outputs": [], "source": [ @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0ded2556", + "id": "82", "metadata": {}, "outputs": [], "source": [ @@ -1166,7 +1166,7 @@ }, { "cell_type": "markdown", - "id": "67ac7131", + "id": "83", "metadata": {}, "source": [ "Note that for consistency, the choices, probabilities of choices,\n", @@ -1179,7 +1179,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c6110f4e", + "id": "84", "metadata": {}, "outputs": [], "source": [ @@ -1189,7 +1189,7 @@ { "cell_type": "code", "execution_count": null, - "id": "bc32808c", + "id": "85", "metadata": {}, "outputs": [], "source": [ @@ -1232,7 +1232,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a6bccd5d", + "id": "86", "metadata": {}, "outputs": [], "source": [ @@ -1271,7 +1271,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3ddd6c3b", + "id": "87", "metadata": {}, "outputs": [], "source": [ @@ -1298,7 +1298,7 @@ }, { "cell_type": "markdown", - "id": "6169e4cc", + "id": "88", "metadata": {}, "source": [ "## Batch Simulation" @@ -1306,7 +1306,7 @@ }, { "cell_type": "markdown", - "id": "a83d4036", + "id": "89", "metadata": {}, "source": [ "Suppose we want to compute logsums not just for one destination, but for many destinations. We can construct a `Dataset` with two dimensions to use at the top of our `DataTree`, one for the tours and one for the candidate destinations." @@ -1315,7 +1315,7 @@ { "cell_type": "code", "execution_count": null, - "id": "39d39131", + "id": "90", "metadata": {}, "outputs": [], "source": [ @@ -1328,7 +1328,7 @@ }, { "cell_type": "markdown", - "id": "fced6ace", + "id": "91", "metadata": {}, "source": [ "Then we can create a very similar DataTree as above, using this two dimension root Dataset, but we will point to our destination zones from the new tour dimension. and then create a flow from that." @@ -1337,7 +1337,7 @@ { "cell_type": "code", "execution_count": null, - "id": "399e875f", + "id": "92", "metadata": {}, "outputs": [], "source": [ @@ -1373,7 +1373,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d7bd3fa", + "id": "93", "metadata": {}, "outputs": [], "source": [ @@ -1383,7 +1383,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8a036273", + "id": "94", "metadata": {}, "outputs": [], "source": [ @@ -1394,7 +1394,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d19548d9", + "id": "95", "metadata": {}, "outputs": [], "source": [ @@ -1430,7 +1430,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ef2d38ae", + "id": "96", "metadata": {}, "outputs": [], "source": [ @@ -1444,7 +1444,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9d5e74df", + "id": "97", "metadata": {}, "outputs": [], "source": [ @@ -1459,7 +1459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a9b0e5c5", + "id": "98", "metadata": {}, "outputs": [], "source": [ @@ -1478,7 +1478,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0dc7210b", + "id": "99", "metadata": {}, "outputs": [], "source": [ @@ -1496,7 +1496,7 @@ { "cell_type": "code", "execution_count": null, - "id": "92d83292", + "id": "100", "metadata": {}, "outputs": [], "source": [ @@ -1524,7 +1524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "de8251d3", + "id": "101", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/walkthrough/sparse.ipynb b/docs/walkthrough/sparse.ipynb index dc4415d..c425ae0 100644 --- a/docs/walkthrough/sparse.ipynb +++ b/docs/walkthrough/sparse.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "c871b4c1", + "id": "0", "metadata": {}, "source": [ "# Using Sparse MAZ Skims" @@ -11,7 +11,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b8401e0f", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -23,7 +23,7 @@ }, { "cell_type": "markdown", - "id": "20bc86e7", + "id": "2", "metadata": {}, "source": [ "This notebook walks through using sparse MAZ to MAZ skims with sharrow.\n", @@ -34,7 +34,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d8982a01", + "id": "3", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +44,7 @@ }, { "cell_type": "markdown", - "id": "35396a40", + "id": "4", "metadata": {}, "source": [ "We'll also load a MAZ-to-TAZ mapping file, which defines the MAZ's and \n", @@ -54,7 +54,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dae3b485", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -64,7 +64,7 @@ }, { "cell_type": "markdown", - "id": "4639626f", + "id": "6", "metadata": {}, "source": [ "Lastly, we'll load a sparse MAZ-to-MAZ skim table. This table\n", @@ -79,7 +79,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1e10b2e2", + "id": "7", "metadata": {}, "outputs": [], "source": [ @@ -89,7 +89,7 @@ }, { "cell_type": "markdown", - "id": "a8eb5269", + "id": "8", "metadata": {}, "source": [ "To integrate these data sources, we will set a redirection on the skims.\n", @@ -101,7 +101,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8071c236", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -116,7 +116,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a4323483", + "id": "10", "metadata": {}, "outputs": [], "source": [ @@ -125,7 +125,7 @@ }, { "cell_type": "markdown", - "id": "d1105ef9", + "id": "11", "metadata": {}, "source": [ "Next, we can attach the sparse skims using `redirection.sparse_blender`.\n", @@ -136,7 +136,7 @@ { "cell_type": "code", "execution_count": null, - "id": "2269a8c2", + "id": "12", "metadata": {}, "outputs": [], "source": [ @@ -153,7 +153,7 @@ }, { "cell_type": "markdown", - "id": "ff55a65d", + "id": "13", "metadata": {}, "source": [ "Now the skims are ready to use!\n", @@ -166,7 +166,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4eaf4dbb", + "id": "14", "metadata": {}, "outputs": [], "source": [ @@ -181,7 +181,7 @@ }, { "cell_type": "markdown", - "id": "998d16be", + "id": "15", "metadata": {}, "source": [ "We'll then put the trips together with the skims into a DataTree, as\n", @@ -191,7 +191,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60a6848c", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -207,7 +207,7 @@ }, { "cell_type": "markdown", - "id": "a3523e22", + "id": "17", "metadata": {}, "source": [ "Now we can setup flows on this tree." @@ -216,7 +216,7 @@ { "cell_type": "code", "execution_count": null, - "id": "be2e86f3", + "id": "18", "metadata": {}, "outputs": [], "source": [ @@ -231,7 +231,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a43c2b0", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -240,7 +240,7 @@ }, { "cell_type": "markdown", - "id": "8d7b3902", + "id": "20", "metadata": {}, "source": [ "Where the sparse (maz) data is missing or exceeds the max blending distance,\n", @@ -251,7 +251,7 @@ { "cell_type": "code", "execution_count": null, - "id": "fa6dc462", + "id": "21", "metadata": {}, "outputs": [], "source": [ @@ -276,7 +276,7 @@ }, { "cell_type": "markdown", - "id": "9b4604e3", + "id": "22", "metadata": {}, "source": [ "We can apply all the transformation we like, as usual." @@ -285,7 +285,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6b9aa948", + "id": "23", "metadata": {}, "outputs": [], "source": [ @@ -301,7 +301,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1526e25b", + "id": "24", "metadata": {}, "outputs": [], "source": [ @@ -311,7 +311,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a2fd8300", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -332,7 +332,7 @@ }, { "cell_type": "markdown", - "id": "d0d40e91", + "id": "26", "metadata": {}, "source": [ "## Using at and iat\n", @@ -350,7 +350,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1a3971fb", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -364,7 +364,7 @@ { "cell_type": "code", "execution_count": null, - "id": "48c42f7c", + "id": "28", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ { "cell_type": "code", "execution_count": null, - "id": "20f06ab5", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -412,7 +412,7 @@ { "cell_type": "code", "execution_count": null, - "id": "eaf576ea", + "id": "30", "metadata": {}, "outputs": [], "source": [ @@ -434,7 +434,7 @@ }, { "cell_type": "markdown", - "id": "68dcc914", + "id": "31", "metadata": {}, "source": [ "To circumvent the redirection, and sparse lookup and blending,\n", @@ -444,7 +444,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9117a3d2", + "id": "32", "metadata": {}, "outputs": [], "source": [ @@ -459,7 +459,7 @@ { "cell_type": "code", "execution_count": null, - "id": "34b334d4", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -473,7 +473,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b1078ea4", + "id": "34", "metadata": {}, "outputs": [], "source": [ @@ -524,7 +524,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a25cafa0", + "id": "35", "metadata": {}, "outputs": [], "source": [ @@ -537,7 +537,7 @@ { "cell_type": "code", "execution_count": null, - "id": "96a7c554", + "id": "36", "metadata": {}, "outputs": [], "source": [ diff --git a/docs/walkthrough/two-dim.ipynb b/docs/walkthrough/two-dim.ipynb index 4b68245..71e8b1e 100644 --- a/docs/walkthrough/two-dim.ipynb +++ b/docs/walkthrough/two-dim.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "7998b969", + "id": "0", "metadata": {}, "source": [ "# Multi-Dimensional Analysis\n", @@ -14,7 +14,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d4e7246c", + "id": "1", "metadata": {}, "outputs": [], "source": [ @@ -29,7 +29,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1f409525", + "id": "2", "metadata": { "tags": [ "remove-cell" @@ -45,7 +45,7 @@ }, { "cell_type": "markdown", - "id": "6085397c", + "id": "3", "metadata": {}, "source": [ "## Example Data\n", @@ -63,7 +63,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56f4bb4d", + "id": "4", "metadata": {}, "outputs": [], "source": [ @@ -74,7 +74,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5a369bd3", + "id": "5", "metadata": { "tags": [ "remove-cell" @@ -91,7 +91,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f2db078", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -102,7 +102,7 @@ { "cell_type": "code", "execution_count": null, - "id": "56ef0b92", + "id": "7", "metadata": { "tags": [ "remove-cell" @@ -117,7 +117,7 @@ }, { "cell_type": "markdown", - "id": "077d2d46", + "id": "8", "metadata": {}, "source": [ "The skims, on the other hand, are not just simple tabular data, but rather a \n", @@ -129,7 +129,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b087c457", + "id": "9", "metadata": {}, "outputs": [], "source": [ @@ -139,7 +139,7 @@ }, { "cell_type": "markdown", - "id": "9e3226ae", + "id": "10", "metadata": {}, "source": [ "For this example, we'll also load a land use table, that contains some attributes of the alternatives." @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ca135ccd", + "id": "11", "metadata": {}, "outputs": [], "source": [ @@ -158,7 +158,7 @@ }, { "cell_type": "markdown", - "id": "266f2390", + "id": "12", "metadata": {}, "source": [ "## Multi-Dimensional Analysis\n", @@ -177,7 +177,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37b86b79", + "id": "13", "metadata": {}, "outputs": [], "source": [ @@ -187,7 +187,7 @@ }, { "cell_type": "markdown", - "id": "331a24d4", + "id": "14", "metadata": {}, "source": [ "As we filter the persons table to just the workers, we also renamed the index from\n", @@ -198,7 +198,7 @@ }, { "cell_type": "markdown", - "id": "79f95d17", + "id": "15", "metadata": {}, "source": [ "For our workplace location choice model, we will want to link in data from our skims,\n", @@ -212,7 +212,7 @@ { "cell_type": "code", "execution_count": null, - "id": "c76e7781", + "id": "16", "metadata": {}, "outputs": [], "source": [ @@ -222,7 +222,7 @@ }, { "cell_type": "markdown", - "id": "7168de32", + "id": "17", "metadata": {}, "source": [ "## Creating a DataTree Iteratively" @@ -230,7 +230,7 @@ }, { "cell_type": "markdown", - "id": "80968843", + "id": "18", "metadata": {}, "source": [ "The last step in getting ready for this model is building out the relationships between all\n", @@ -242,7 +242,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f68826ca", + "id": "19", "metadata": {}, "outputs": [], "source": [ @@ -255,7 +255,7 @@ { "cell_type": "code", "execution_count": null, - "id": "f2ba1f96", + "id": "20", "metadata": {}, "outputs": [], "source": [ @@ -264,7 +264,7 @@ }, { "cell_type": "markdown", - "id": "824c3c0c", + "id": "21", "metadata": {}, "source": [ "Since our base dataset has\n", @@ -276,7 +276,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ec526ae0", + "id": "22", "metadata": {}, "outputs": [], "source": [ @@ -286,7 +286,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b0a4e36", + "id": "23", "metadata": { "tags": [ "remove-cell" @@ -301,7 +301,7 @@ }, { "cell_type": "markdown", - "id": "a49bd3f5", + "id": "24", "metadata": {}, "source": [ "Then, we can progressively build our `DataTree` by adding additional data. \n", @@ -314,7 +314,7 @@ { "cell_type": "code", "execution_count": null, - "id": "a594e5e1", + "id": "25", "metadata": {}, "outputs": [], "source": [ @@ -323,7 +323,7 @@ }, { "cell_type": "markdown", - "id": "f145858c", + "id": "26", "metadata": {}, "source": [ "The relationship definition here starts with a dotted name of some data \n", @@ -334,7 +334,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4e270e91", + "id": "27", "metadata": {}, "outputs": [], "source": [ @@ -344,7 +344,7 @@ }, { "cell_type": "markdown", - "id": "bd7546c0", + "id": "28", "metadata": {}, "source": [ "Unlike in the mode choice work in the previous example, we've already filtered the \n", @@ -356,7 +356,7 @@ { "cell_type": "code", "execution_count": null, - "id": "b7a256e0", + "id": "29", "metadata": {}, "outputs": [], "source": [ @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "3d24e888", + "id": "30", "metadata": {}, "source": [ "## Dynamically Defined Flows \n", @@ -395,7 +395,7 @@ { "cell_type": "code", "execution_count": null, - "id": "273996a2", + "id": "31", "metadata": {}, "outputs": [], "source": [ @@ -411,7 +411,7 @@ }, { "cell_type": "markdown", - "id": "02235003", + "id": "32", "metadata": {}, "source": [ "Loading from this flow is done the same as before." @@ -420,7 +420,7 @@ { "cell_type": "code", "execution_count": null, - "id": "45fd341d", + "id": "33", "metadata": {}, "outputs": [], "source": [ @@ -431,7 +431,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f7aa608", + "id": "34", "metadata": { "tags": [ "remove-cell" @@ -487,7 +487,7 @@ }, { "cell_type": "markdown", - "id": "f121385a", + "id": "35", "metadata": {}, "source": [ "For the tour mode example above, the tours dataset had only one dimension (TOURIDX),\n", @@ -499,7 +499,7 @@ { "cell_type": "code", "execution_count": null, - "id": "13782036", + "id": "36", "metadata": {}, "outputs": [], "source": [ @@ -508,7 +508,7 @@ }, { "cell_type": "markdown", - "id": "e9de50ce", + "id": "37", "metadata": {}, "source": [ "Just as we could neatly format the two-dimensional output above as a `pandas.DataFrame`,\n", @@ -518,7 +518,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e1dfa88c", + "id": "38", "metadata": {}, "outputs": [], "source": [ @@ -529,7 +529,7 @@ { "cell_type": "code", "execution_count": null, - "id": "03bb0e22", + "id": "39", "metadata": { "tags": [ "remove-cell" @@ -557,7 +557,7 @@ }, { "cell_type": "markdown", - "id": "5fce998b", + "id": "40", "metadata": {}, "source": [ "## Linear-in-Parameters Functions\n", @@ -570,7 +570,7 @@ { "cell_type": "code", "execution_count": null, - "id": "504897a4", + "id": "41", "metadata": {}, "outputs": [], "source": [ @@ -580,7 +580,7 @@ }, { "cell_type": "markdown", - "id": "f95acc3c", + "id": "42", "metadata": {}, "source": [ "The `dot_dataarray` method does the same underlying computational work, but \n", @@ -590,7 +590,7 @@ { "cell_type": "code", "execution_count": null, - "id": "ae61561a", + "id": "43", "metadata": {}, "outputs": [], "source": [ @@ -599,7 +599,7 @@ }, { "cell_type": "markdown", - "id": "5ff32a79", + "id": "44", "metadata": {}, "source": [ "## Multinomial Logit Simulation\n", @@ -613,7 +613,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3dec4791", + "id": "45", "metadata": {}, "outputs": [], "source": [ @@ -623,7 +623,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f032eef", + "id": "46", "metadata": {}, "outputs": [], "source": [ @@ -636,7 +636,7 @@ { "cell_type": "code", "execution_count": null, - "id": "1401fbe4", + "id": "47", "metadata": {}, "outputs": [], "source": [ @@ -646,7 +646,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4050bdce", + "id": "48", "metadata": {}, "outputs": [], "source": [ @@ -656,7 +656,7 @@ { "cell_type": "code", "execution_count": null, - "id": "01e87f9f", + "id": "49", "metadata": { "tags": [ "remove-cell" @@ -816,7 +816,7 @@ { "cell_type": "code", "execution_count": null, - "id": "3a6163c0", + "id": "50", "metadata": {}, "outputs": [], "source": [ @@ -838,7 +838,7 @@ }, { "cell_type": "markdown", - "id": "f700d084", + "id": "51", "metadata": {}, "source": [ "It's more common to make many repeated choices for destination choice type models\n", @@ -849,7 +849,7 @@ { "cell_type": "code", "execution_count": null, - "id": "93d030f5", + "id": "52", "metadata": {}, "outputs": [], "source": [ @@ -862,7 +862,7 @@ }, { "cell_type": "markdown", - "id": "e6a84dab", + "id": "53", "metadata": {}, "source": [ "If you compare against the non-pick-counted results above, you'll see \n", @@ -873,7 +873,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0d7303c8", + "id": "54", "metadata": {}, "outputs": [], "source": [ @@ -883,7 +883,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8bcb1a84", + "id": "55", "metadata": {}, "outputs": [], "source": [ @@ -893,7 +893,7 @@ { "cell_type": "code", "execution_count": null, - "id": "dfd6d42a", + "id": "56", "metadata": { "tags": [ "remove-cell" @@ -913,7 +913,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7877231e", + "id": "57", "metadata": {}, "outputs": [], "source": [ @@ -934,7 +934,7 @@ }, { "cell_type": "markdown", - "id": "289a75a1", + "id": "58", "metadata": {}, "source": [ "### Accessing Logsums\n", @@ -948,7 +948,7 @@ { "cell_type": "code", "execution_count": null, - "id": "8f761b5c", + "id": "59", "metadata": {}, "outputs": [], "source": [ @@ -963,7 +963,7 @@ { "cell_type": "code", "execution_count": null, - "id": "d1ec6c28", + "id": "60", "metadata": {}, "outputs": [], "source": [ @@ -990,7 +990,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7f6bc921", + "id": "61", "metadata": {}, "outputs": [], "source": [ @@ -1012,7 +1012,7 @@ }, { "cell_type": "markdown", - "id": "bc317541", + "id": "62", "metadata": {}, "source": [ "## Gotchas\n", @@ -1026,7 +1026,7 @@ { "cell_type": "code", "execution_count": null, - "id": "737bc7c6", + "id": "63", "metadata": {}, "outputs": [], "source": [ @@ -1052,7 +1052,7 @@ { "cell_type": "code", "execution_count": null, - "id": "e26a7f58", + "id": "64", "metadata": { "tags": [ "remove-cell" @@ -1068,7 +1068,7 @@ { "cell_type": "code", "execution_count": null, - "id": "16b86578", + "id": "65", "metadata": {}, "outputs": [], "source": [ @@ -1080,7 +1080,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4a4fb08e", + "id": "66", "metadata": { "tags": [ "remove-cell"