Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CMSE 201 Intended Learning Outcomes
<h1 id="thinking-about-learning-objectives-as-a-process-of-modeling">Thinking about learning objectives as a process of modeling</h1>
<h2 id="1---modeling-begins-before-you-ever-touch-a-computer">1 - Modeling begins before you ever touch a computer</h2>
<ul>
<li>How do I understand the system of interest?</li>
<li>Within that system, what phenomena am I interested in?</li>
<li>What entities do I think are relevant for my model?</li>
<li>How might I qualitatively describe entity relationships in the model? (Example: predators hunt prey, so predators should have some contribution to the reduction of prey.)</li>
<li>What simplifications do I <em>know</em> I’m making?</li>
<li>How can I express expectations of/predictions about the model? (E.g., with one wolf and 10 million rabbits, I don’t think there will be much of a predator effect. Or: here’s a sketch of the path I think this orbiting body might take. Or: based on <a href="https://kerbalspaceprogram.com/kspstore/index.php?p=22">my experiences with kerbal space program</a>, I figure the object would take a path like this.)</li>
</ul>
<h3 id="11-for-a-given-situation-to-be-modeled-students-will-be-able-to">1.1 For a given situation-to-be-modeled, Students will be able to</h3>
<ul>
<li><strong>describe one or more phenomena</strong> they want their model to address.</li>
<li><strong>state and justify</strong> (with words, pictures, gestures) which <strong>entities they care about</strong> for this model. . (“Our model needs to include/account for <em>__ because __</em>). This can also be phrased as <strong>state and justify the inclusion of entities in their model</strong></li>
<li><strong>identify and justify simplifications</strong> their model makes. (Our model ignores air resistance because ___)</li>
<li><strong>qualitatively describe entity relationships in the model.</strong> (E.g., the traffic jam may propagate backwards through traffic, because each car won’t decelerate until it’s within x of the rear bumper of the car in front. Or: roughly speaking, a wolf will seek a rabbit if it finds one, and a rabbit will evade a wolf if it detects one.)</li>
<li><strong>predict or hypothesize how the model may behave</strong> (E.g., If we give cars on the highway high initial speeds and a very low braking distance threshold (how far from the next car they’ll be before they start decelerating), there will be guaranteed crashes. Or: If rabbits are fast and can hear wolves coming from far away, the wolves won’t be successful predators. But, if we can somehow get the wolves to hunt as a pack and surround a rabbit, they should be better able to catch rabbits.) One way we might start to assess this is “if you wanted to tweak the simulation to make the wolves better hunters without changing the rabbit behavior, what might you do?” Or “suppose the wolf population could adapt and become more efficient at hunting rabbits. Give an example of a new behavior you might give them to hunt more efficiently and show in pseudocode how you might roughly encode the behavior into the model.)</li>
</ul>
<h2 id="2---formalizing-the-model">2 - Formalizing the model</h2>
<ul>
<li>What are different ways we might encode/represent a model? (difference equations? Python Code? stock/flow/converter diagrams? other diagrams?)</li>
<li>For many of the models we’ll build, we’ll need to be able to express behaviors, do some calculations, and store/move/manipulate some data. In service of those aims, in Python, how can we
<ul>
<li>Store information for use later?</li>
<li>Represent numbers and convert between their forms? (Int, Float)</li>
<li>Perform operations on numbers (for example, arithmetic. If you’ve never programmed before, <code class="highlighter-rouge">*</code> as the multiplication operator may not be obvious)</li>
<li>Represent letters/words?</li>
<li>Perform operations on letters/words? (Find regular patterns, make substitutions, convert case, concatenate, split)?</li>
<li>Create data by composing words/letters and numbers? (Lists are ordered like trains. Dicts are kind of like buckets of labeled stuff.)</li>
<li>Perform repeated operations on those compositions, including iteration. (If we learn primitives and manipulating primitives, then it makes sense to learn compositions and manipulating compositions.)</li>
<li>Bundle up repeated operations so they’re easier to invoke/apply later (function definition)</li>
<li>Pull in external collections of bundled-up procedures (import other modules/packages/libraries)</li>
</ul>
</li>
<li>For many of the models we’ll build, we’ll try to take advantage of specific advantages we get for free with SciPy and NumPy. In SciPy/NumPy how can we:
<ul>
<li>Get statistical information about a collection of numerical data. (the <code class="highlighter-rouge">max</code>, <code class="highlighter-rouge">min</code>, <code class="highlighter-rouge">cumsum</code>, <code class="highlighter-rouge">var</code> and <code class="highlighter-rouge">mean</code> methods of <code class="highlighter-rouge">ndarray</code>, for example)</li>
<li>Perform operations using the numbers in a collection (the <code class="highlighter-rouge">sum</code> method of an <code class="highlighter-rouge">ndarray</code>, for example)</li>
<li>Iterate over an array of data (<code class="highlighter-rouge">numpy.nditer</code>?)</li>
<li>// Fill in more objectives here</li>
</ul>
</li>
<li>How can we see different representational forms as comparable articulations of the same model?
<ul>
<li>How do changes to one representation of a model correspond to changes in one or more other representations?
<ul>
<li>If we change a relationship in a model diagram, how does that affect any difference equations we might have written?</li>
</ul>
</li>
</ul>
</li>
<li>What are the different kinds of engines/paradigms that can drive models?
<ul>
<li>Deterministic systems with a centralized parameter (such as time), where objects in the model update in response to discrete, progressive changes to that parameter. Here, our main task is to specify update procedures as functions of the parameters of the system.</li>
<li>Stochastic (dice rolling) processes, where we inject elements of randomness and/or probability
<ul>
<li>Why would we want to make a model non-deterministic?</li>
<li>Why would we include randomness?</li>
</ul>
</li>
<li>Agent-based Modeling, where we’re trying to produce simple rule-based behavior to govern individual parts of the system. Rather than thinking of these as system-wide updates based on parameters, we can think of this as individual agents <em>reacting</em> to their own state and what’s around them.</li>
<li>Markov Chain Monte-Carlo</li>
</ul>
</li>
</ul>
<h3 id="21-when-it-comes-to-formalizing-models-students-will-be-able-to">2.1 When it comes to formalizing models, students will be able to</h3>
<h4 id="in-scratch">In Scratch:</h4>
<ul>
<li>Use triggers (events) to start/stop a program</li>
<li>Write a top-level comment on code</li>
<li>Write a code comment attached to a specific block</li>
<li>Identify different datatypes (booleans, expressions, strings)</li>
<li>Use abstractions for iteration (repeat functions) to perform a task multiple times</li>
<li>Use control flow to create conditional branching in code</li>
<li>Create a variable and access its contents</li>
<li>Create a list</li>
<li>Add an item to a list</li>
<li>Delete an item from a list</li>
<li>Replace an item in a list</li>
<li>Use positional indexing to retrieve a list item</li>
<li>Retrieve a slice/subsection of a list</li>
<li>Print debugging output using the “say” block (which, confusingly, is under “Looks”)</li>
<li>Use operations to add, subtract, and multiply two numbers</li>
<li>Write an (in)equality test in terms of one or more variables</li>
<li>Refactor repetitive code using abstraction</li>
<li>Define blocks (functions) that wrap chunks of procedures</li>
<li>Predict, Observe, and Explain/Reconcile what a short scratch program (~10 blocks or fewer) will do</li>
</ul>
<h4 id="in-base-python">In base Python:</h4>
<ul>
<li><strong>Store information</strong> for use later</li>
<li><strong>Retrive Stored Information</strong></li>
<li><strong>Represent numbers and convert</strong> between their forms (<code class="highlighter-rouge">Int</code>, <code class="highlighter-rouge">Float</code>)</li>
<li><strong>Perform operations on numbers</strong> (for example, arithmetic. If you’ve never programmed before, <code class="highlighter-rouge">*</code> as the multiplication operator may not be obvious)</li>
<li><strong>Represent letters/words</strong></li>
<li><strong>Perform operations on letters/words</strong> (Find regular patterns, make substitutions, convert case, concatenate, split)?</li>
<li><strong>Create data by composing words/letters and numbers</strong> (Lists are ordered like trains. Dicts are kind of like buckets of labeled stuff.)</li>
<li><strong>Perform repeated operations on those compositions</strong>, including iteration. (If we learn primitives and manipulating primitives, then it makes sense to learn compositions and manipulating compositions.)</li>
<li><strong>Bundle up repeated operations</strong> so they’re easier to invoke/apply later (function definition)</li>
<li><strong>Pull in external collections of bundled-up procedures</strong> (import other modules/packages/libraries)</li>
</ul>
<h4 id="in-numpy--pandas">In NumPy / Pandas</h4>
<ul>
<li><strong>Get statistical information</strong> about a collection of numerical data. (the <code class="highlighter-rouge">max</code>, <code class="highlighter-rouge">min</code>, <code class="highlighter-rouge">cumsum</code>, <code class="highlighter-rouge">var</code> and <code class="highlighter-rouge">mean</code> methods of <code class="highlighter-rouge">ndarray</code>, for example)</li>
<li>Perform operations using the numbers in a collection (the <code class="highlighter-rouge">sum</code> method of an <code class="highlighter-rouge">ndarray</code>, for example)</li>
<li><strong>Iterate over an array of data</strong> (<code class="highlighter-rouge">numpy.nditer</code>?)</li>
<li>// Fill in more objectives here</li>
<li>Across Formal Models:</li>
<li><strong>Express and discuss relationships</strong> between difference equations and a model produced in code(?)</li>
</ul>
<h4 id="across-different-formalisms-of-a-model">Across different formalisms of a model:</h4>
<ul>
<li>Describe how a given piece of code <em>implements</em> a relationship</li>
<li><strong>Determine</strong> whether a piece of code faithfully implements part of a model expressed in some other format (diagram, difference equation)</li>
<li>Across Formal Modeling Paradigms:</li>
<li><strong>Describe and compare the mechanisms of</strong>
<ul>
<li>Deterministic systems with a centralized parameter (such as time), where objects in the model update in response to discrete, progressive changes to that parameter. Here, our main task is to specify update procedures as functions of the parameters of the system.</li>
<li>Agent-based Modeling, where we’re trying to produce simple rule-based behavior to govern individual parts of the system. Rather than thinking of these as system-wide updates based on parameters, we can think of this as individual agents <em>reacting</em> to their own state and what’s around them.</li>
<li>Markov Chain Monte-Carlo</li>
</ul>
</li>
</ul>
<h2 id="3---interrogating-the-model">3 - Interrogating the model</h2>
<h3 id="how-we-think-about-interrogating-the-model">How we think about interrogating the model</h3>
<ul>
<li>How do I figure out what’s happening when I run my model?</li>
<li>What information can I get about my model?
<ul>
<li>What diagnostic plots can I get from my model?
<ul>
<li>lines/functions of best fit</li>
<li>residuals</li>
<li>histograms</li>
</ul>
</li>
<li>What numerical summaries can I get from my data?
<ul>
<li>5-number summary (Tukey)</li>
<li>Measures of central tendency/typicality</li>
<li>Measures of variation</li>
<li>Extrema and outliers</li>
<li>(if available) tables of predicted-vs-actual model results for Supervised learning situations</li>
</ul>
</li>
</ul>
</li>
<li>How does my model behave in extrema/limiting cases?
<ul>
<li>What are some ways I could generate random data to throw at this model?</li>
<li>How can I generate extreme data? What would that mean?</li>
</ul>
</li>
<li>Is this model answering the question I want to ask?</li>
<li>In retrospect, does what comes out of the model echo how the real system behaves/should behave?</li>
<li>What statements can I make (in plain writing, say English) about the performance of my model?</li>
</ul>
<h3 id="31-learning-objectives-for-a-given-model-students-will-be-able-to">3.1 Learning Objectives: For a given model, students will be able to</h3>
<ul>
<li><strong>Enumerate</strong> some techniques (visual, numerical, or other) for interrogating a model. Examples would include calculating a measure of central tendency, plotting actual data vs. model fit, creating distribution diagrams/histograms/kernel density estimates.</li>
<li><strong>implement</strong> at least two different interrogation techniques:</li>
<li><strong>describe</strong> the model’s faithfulness (if it’s time-based, what’s the long-run behavior? if it’s statistical, where do the data depart from the model? If it’s non-parametric, what insight do we get from it?)</li>
<li><strong>Identify the error in their models</strong>, through (for example) tabular summaries of residuals, cumulative residual plots, smoothing and confidence intervals. Example: <img src="http://seaborn.pydata.org/_images/regression_marginals.png" alt="seaborn joint plot with confidence intervals and marginal distributions" />.</li>
<li><strong>Create a plot</strong> to assess model fit</li>
<li><strong>Judge and justify</strong> the appropriateness of a model using diagnostic plots (and justify their reasoning)</li>
</ul>
<h2 id="4---refining-the-model">4 - Refining the model</h2>
<ul>
<li>How do I achieve a better fit?
<ul>
<li>What constitutes a “better fit?”</li>
</ul>
</li>
<li>How do I think about the complexity of my model?
<ul>
<li>What <em>is</em> model complexity?</li>
<li>Should I add terms to my model?</li>
<li>Should I change the value of any of the input parameters?</li>
<li>Should I add interactions to my model?</li>
<li>Should I rethink the mathematical relationships I’ve posed? (the data looks nonlinear, but I’m attempting a linear fit)</li>
</ul>
</li>
<li>How do I understand the trade-off between interpretability and model complexity?</li>
<li>If I make the model more complex, how will that impact:
<ul>
<li>The time it takes to program/debug</li>
<li>The time it takes to actually execute on a computer</li>
<li>The time it takes to interpret/make sense of the results?</li>
</ul>
</li>
<li>What’s the least I can do to make my model useful? What’s the minimal amount of complexity I need to encode to get something useful?</li>
<li>What information are my diagnostics giving me?
<ul>
<li>How do I think about model refinements in light of that information</li>
</ul>
</li>
</ul>
<h3 id="41---learning-objectives-students-will-be-able-to">4.1 - Learning Objectives: Students will be able to</h3>
<ul>
<li><strong>compare two variations of a model</strong> (say, a linear model and a quadratic model) and argue for which model better captures the phenomenon</li>
<li>For a given model, <strong>interpret their model qualitatively</strong></li>
<li>For a given model, <strong>suggest and justify a refinement to it</strong></li>
</ul>
<h2 id="5---sharingpublicizing-the-model-reproducible-researchopen-science">5 - Sharing/publicizing the model (reproducible research/open science)</h2>
<h3 id="51---learning-objectives-students-will-be-able-to">5.1 - Learning Objectives: Students will be able to</h3>
<ul>
<li><strong>Create an iPython Notebook</strong> that mixes both Python code and explanatory markdown</li>
<li><strong>Share an iPython Notebook</strong> using NBconvert / NBviewer</li>
<li><strong>Download someone’s existing iPython Notebook</strong>
<ul>
<li>Possibly by <em>forking</em> the repository</li>
<li><strong>review someone else’s code</strong></li>
<li><strong>modify their own fork</strong> of the upstream repository</li>
<li><strong>justify their modifications</strong></li>
<li><strong>Issue a pull request</strong> on the upstream repository</li>
</ul>
</li>
</ul>
<h2 id="6---assessingcomparingdebating-models">6 - Assessing/Comparing/Debating models</h2>
<p>// Some of the really cool intellectual meat. Given the kind of diagnostic information we get (cluster 3) and possibly being able to share our models (cluster 5), how do we make decisions about how well the model is working and whether to refine it (cluster 3). This is where we get into the work of justifying a model we’ve built, exploring whether our asusmptions (cluster 1) held sway, and so on.</p>
<p>// 2015-08-26 - I actually think much of this is covered by the first 5 clusters :-/</p>
<h2 id="7---data-science">7 - Data Science</h2>
<h3 id="understanding-data">Understanding data</h3>
<ul>
<li>Determine the feature-space (what are the columns?)</li>
<li>Make a dataset <a href="https://www.jstatsoft.org/index.php/jss/article/view/v059i10/v59i10.pdf">tidy</a></li>
<li>Get numerical summaries of data (mean, median, mode, variance)</li>
<li>Create a procedure for a statistic (mean, median, mode)</li>
<li>Visually and numerically examine correlations between features</li>
<li>Filter a dataset’s rows by some condition, for example <code class="highlighter-rouge">flint_data[flint_data['lead_levels'] &gt; legal_limit]</code></li>
<li>Group a dataset by categorical values (<code class="highlighter-rouge">flint_data.groupby('zip_code').sum()</code>)</li>
<li>Generate a by-group analysis based on values of a feature (for example, with aggregate statistics like sum, count, mean)</li>
<li>Given a dataset, fit a parametric model to the data</li>
<li>As in modeling, assess the fit, faithfulness, and limitations of the model</li>
</ul>
<h3 id="plotting">Plotting</h3>
<ul>
<li>Plot and <em>interpret</em> a distribution of 1-variable</li>
<li>Plot and <em>interpret</em> a graphic of multiple variables [scatterplot, box-and-whiskers, pie chart, time series, line graph, bar graph, compositions of plots, experimental scatterplot, subplots, contour plot]</li>
<li>Use aesthetics to encode multiple dimensions of information into a single plot (e.g., using stroke-color, shape, size, fill-color, opacity, and line-type to encode additional information)</li>
<li>Use <a href="https://en.wikipedia.org/wiki/Small_multiple">small multiples</a> to encode multiple dimensions of information into a single plot (facetting by a variable, for example, or a <a href="http://docs.ggplot2.org/0.9.2.1/plotmatrix.html">scatterplot matrix</a></li>
</ul>
<h3 id="fitting-a-model-to-data">Fitting a model to data</h3>
<ul>
<li>Describe the iterative process of updating the state of a variable</li>
<li>Recognize the relationship between a differential equation, difference equation, and state-update code in a model</li>
<li>Given a 2-dimensional dataset, try choosing parameters to minimize ordinary least squares error</li>
<li>Enact a gradient descent by playing the role of a walker (blindfolded student) and a guide (who gives gradient information). See “Gradient Descent Activity”</li>
<li>Write a simple python program to do gradient descent on a slope-intercept linear model</li>
<li>Use scikit-learn’s stochastic gradient descent to fit a multi-feature linear model (multiple linear regression)</li>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment