This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data { | |
| int<lower=3> n; | |
| vector[n] y; | |
| int<lower=0> h; | |
| } | |
| parameters { | |
| real<lower=0, upper=1> alpha; | |
| real<lower=0, upper=1> beta; | |
| real<lower=0> sigma; | |
| vector[2] mu_init; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| set.seed(123) | |
| # simulated data | |
| n <- 100 | |
| nx <- ny <- 500 | |
| x <- rbinom(n, nx, 0.22) | |
| y <- rbinom(n, ny, 0.21) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import numpy as np | |
| class RadialBasisFunctions(object): | |
| """Radial Basis Functions features for time-series data | |
| Parameters | |
| ---------- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import Counter | |
| class PopularityEncoder(object): | |
| def __init__(self, vocab_size=50000): | |
| """Encode words according to popularity index | |
| Parameters | |
| ---------- | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # source: https://github.com/scikit-learn/scikit-learn/issues/10810#issuecomment-373164104 | |
| import copy | |
| def prune(tree): | |
| tree = copy.deepcopy(tree) | |
| dat = tree.tree_ | |
| nodes = range(0, dat.node_count) | |
| ls = dat.children_left | |
| rs = dat.children_right |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.