Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Examples to Altair #31

Merged
merged 9 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,8 @@ target/
paper/paper.pdf
paper/paper.jats
docs/sg_execution_times.rst
docs/_images/*.png
docs/_static/*.png
docs/_images/_image_hashes.json
docs/_static/_image_hashes.json
docs/gallery/*.rst
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Quantile regression forests (QRF) are a non-parametric, tree-based ensemble method for estimating conditional quantiles, with application to high-dimensional data and uncertainty estimation [[1]](#1). The estimators in this package are performant, Cython-optimized QRF implementations that extend the forest estimators available in scikit-learn to estimate conditional quantiles. The estimators can estimate arbitrary quantiles at prediction time without retraining and provide methods for out-of-bag estimation, calculating quantile ranks, and computing proximity counts. They are compatible with and can serve as drop-in replacements for the scikit-learn variants.

#### Example of fitted model predictions and prediction intervals on California housing data ([code](https://zillow.github.io/quantile-forest/auto_examples/plot_quantile_regression_intervals.html#sphx-glr-auto-examples-plot-quantile-regression-intervals-py))
<img src="https://zillow.github.io/quantile-forest/_images/sphx_glr_plot_quantile_regression_intervals_001.png" height="300" />
<img src="https://zillow.github.io/quantile-forest/_static/plot_quantile_intervals.png" height="300" />

Quick Start
-----------
Expand Down
147 changes: 147 additions & 0 deletions docs/_static/css/gallery.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.figure {
float: left;
margin: 10px;
width: auto;
height: 220px;
}

.figure.minigallery {
height: auto;
}

.figure img {
display: inline;
padding:1px;
border:1px solid #DDDDDD;
opacity:1.0;
filter:alpha(opacity=100); /* For IE8 and earlier */
}

.figure img:hover {
border:1px solid #EEEEEE;
opacity: 0.8;
filter:alpha(opacity=80); /* For IE8 and earlier */
}

.figure .caption {
width: 200px;
text-align: center !important;
}

.figure p {
margin-top: 0;
}

div.section h2 {
padding-top: 30px;
border-bottom: 1px solid #cccccc;
}

div.bottomnav {
clear: left;
}

/* Front-page Example Showcase */
#showcase {
width: 100%;
height: 300px;
overflow: hidden;
margin: 0;
padding: 0;
position: absolute;
left: 0;
right: 0;
margin-bottom: 10px;
}
#showcase:after,
#showcase:before {
content: "";
display: block;
width: 100%;
position: absolute;
background: white;
height: 16px;
z-index: 2;
}
#showcase:before {
bottom: -16px;
box-shadow: 0px -8px 16px rgba(0,0,0,0.3);
}
#showcase:after {
top: -16px;
box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
}
#showcase .examples {
margin: 0 auto;
height: 300px;
line-height: 0;
/* Width and padding settings give the example showcase the same width
as the page header on a big screen. On smaller screens, they both will
have the same width anyway as the title header is responsive and gets narrower
and the example showcase gets clipped by the overflow: hidden setting. */
width: 88rem;
padding-left: 1rem;
padding-right: 1rem;
}
#showcase .preview {
/* Value is chosen through trial and error so that the examples fill out the
whole width which is defined in #showcase .examples */
width: 172px;
height: 100px;
padding: 0;
outline: 1px solid #ddd;
background-position: left top;
background-size: cover;
overflow: hidden;
position: relative;
z-index: 0;
transition: background-position 2s;
display: block;
float: left
}
#showcase .preview:hover {
background-position: right bottom;
outline: 2px solid #4682B4;
z-index: 1;
}

/* Example Gallery */

.gallery {
display: flex;
flex-wrap: wrap;
margin: 0 -12px;
}
.gallery .imagegroup {
display: inline-block;
position: relative;
/* Show 4 images per row, each image has 18px horizontal margin */
width: calc(25% - 36px);
margin: 12px 18px;
/* For small screens */
min-width: 140px;
}

.gallery .imagegroup:hover {
text-decoration: none;
}
.gallery .image {
background-size: cover;
display: block;
width: 100%;
/* Hack to make height depend on width, golden ratio */
padding-bottom: 75%;
background-repeat: no-repeat;
margin-bottom: 5px;
overflow: hidden;
transition: background-position 2s;
}
.gallery .image:hover {
background-position: right bottom;
}

.gallery .image-title {
font-size: .95em;
display: block;
line-height: 22px;
}
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import sys
from datetime import datetime

sys.path.insert(0, os.path.abspath(".."))

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand All @@ -33,8 +35,9 @@
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"numpydoc",
"sphinx_gallery.gen_gallery",
"sphinxcontrib.bibtex",
"sphinxext_altair.altairplot",
"sphinxext.gallery",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -100,6 +103,7 @@
html_style = "css/quantile-forest.css"
html_css_files = [
"css/quantile-forest.css",
"css/gallery.css",
]
html_sidebars = {
"changelog": [],
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Quantile regression forests (QRF) are a non-parametric, tree-based ensemble meth
:maxdepth: 2
:hidden:

auto_examples/index
gallery/index

`Getting Started <install.html>`_
-------------------------------------
Expand Down
11 changes: 6 additions & 5 deletions docs/sphinx_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
sphinx
sphinx_gallery
sphinx_rtd_theme
sphinxcontrib.bibtex
pydata_sphinx_theme
altair
numpydoc
matplotlib
pillow
pydata_sphinx_theme
sphinxcontrib.bibtex
sphinxext-altair
vl-convert-python
6 changes: 0 additions & 6 deletions examples/README.txt

This file was deleted.

Loading