Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FBruzzesi committed May 17, 2024
1 parent 690ce17 commit bce8056
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 6 additions & 0 deletions docs/api/sklearn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Scikit-learn Compatible Time Based Cross Validation

::: timebasedcv.sklearn.TimeBasedCVSplitter
options:
show_root_full_path: false
show_root_heading: true
9 changes: 3 additions & 6 deletions docs/api/timebasedsplit.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# TimeBased Cross Validation

::: timebasedcv.timebasedsplit.TimeBasedCVSplitter
options:
show_root_full_path: false
show_root_heading: true

::: timebasedcv.timebasedsplit.TimeBasedSplit
options:
show_root_full_path: false
show_root_heading: true
members:
- split

::: timebasedcv.timebasedsplit.ExpandingTimeSplit
options:
Expand All @@ -25,6 +22,6 @@
show_root_full_path: false
show_root_heading: true
members:
- split
- _splits_from_period
- n_splits_of
- split
9 changes: 4 additions & 5 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ watch:
use_directory_urls: true
theme:
name: material
font:
text: Ubuntu
code: Ubuntu Mono
font: false
palette:
- media: '(prefers-color-scheme: light)'
scheme: default
Expand Down Expand Up @@ -49,11 +47,11 @@ theme:
- content.code.copy
- content.tooltips
- content.tabs.link

- search.suggest
- search.highlight
- search.share

- toc.follow

logo: img/timebasedcv-logo.png
Expand Down Expand Up @@ -114,6 +112,7 @@ nav:
- Getting Started: getting-started.md
- API:
- Time based splits: api/timebasedsplit.md
- Scikit-learn Compatible CV: api/sklearn.md
- Split state: api/splitstate.md
- Types and protocols: api/types.md
- Contributing: contribute.md
6 changes: 2 additions & 4 deletions timebasedcv/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,15 @@ class TimeBasedCVSplitter(BaseCrossValidator):
from sklearn.linear_model import Ridge
from sklearn.model_selection import RandomizedSearchCV
from timebasedcv import TimeBasedCVSplitter
from timebasedcv.sklearn import TimeBasedCVSplitter
start_dt = pd.Timestamp(2023, 1, 1)
end_dt = pd.Timestamp(2023, 1, 31)
time_series = pd.Series(pd.date_range(start_dt, end_dt, freq="D"))
size = len(time_series)
df = (
pd.DataFrame(data=np.random.randn(size, 2), columns=["a", "b"]).assign(y=lambda t: t[["a", "b"]].sum(axis=1)),
)
df = pd.DataFrame(data=np.random.randn(size, 2), columns=["a", "b"]).assign(y=lambda t: t[["a", "b"]].sum(axis=1))
X, y = df[["a", "b"]], df["y"]
Expand Down

0 comments on commit bce8056

Please sign in to comment.