Skip to content

Instantly share code, notes, and snippets.

@atorch
atorch / simple_prediction_interval.py
Last active June 25, 2021 21:22
Simple constant-width prediction intervals
"""
See https://stats.stackexchange.com/questions/524863/simple-constant-width-prediction-interval-for-a-regression-model
"""
import numpy as np
import pandas as pd
from catboost import CatBoostRegressor
def simulate_dataframe(n_obs=1000):