Skip to content

Instantly share code, notes, and snippets.

View willtownes's full-sized avatar

Will Townes willtownes

View GitHub Profile
@willtownes
willtownes / gpflow_multioutput.py
Created September 21, 2020 15:04
GPflow multioutput
from gpflow.conditionals import conditional
from gpflow.inducing_variables import SeparateIndependentInducingVariables
from gpflow.kernels import SeparateIndependent
#note: object 'm' is of type gpflow.models.svgp.SVGP
ind_conditional = conditional.dispatch(
object, SeparateIndependentInducingVariables, SeparateIndependent, object)
gmu, gvar = ind_conditional(
X,
@willtownes
willtownes / grigorev_twitter_question.py
Created February 5, 2021 16:46
Grigorev twitter interview question
"""
From https://twitter.com/Al_Grigor/status/1357028887209902088
Most candidates cannot solve this interview problem:
* Input: "aaaabbbcca"
* Output: [("a", 4), ("b", 3), ("c", 2), ("a", 1)]
Write a function that converts the input to the output
I ask it in the screening interview and give it 25 minutes
How would you solve it?
"""
@willtownes
willtownes / poisson_prediction_interval.Rmd
Created November 21, 2023 21:34
Prediction interval for Poisson regression
---
title: "Poisson prediction interval"
author: "Will Townes"
output: html_document
---
Poisson prediction interval based on [Kim et al 2022](https://doi.org/10.1002/wics.1568)
```{r}
n<-100