Skip to content

Commit

Permalink
DOC Added an example for the sklearn.datasets.get_data_home (scikit-l…
Browse files Browse the repository at this point in the history
…earn#28290)

Co-authored-by: Arturo Amor <86408019+ArturoAmorQ@users.noreply.github.com>
  • Loading branch information
xavierbeltran and ArturoAmorQ authored Feb 28, 2024
1 parent f3310d2 commit b27894e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sklearn/datasets/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def get_data_home(data_home=None) -> str:
-------
data_home: str
The path to scikit-learn data directory.
Examples
--------
>>> import os
>>> from sklearn.datasets import get_data_home
>>> data_home_path = get_data_home()
>>> os.path.exists(data_home_path)
True
"""
if data_home is None:
data_home = environ.get("SCIKIT_LEARN_DATA", join("~", "scikit_learn_data"))
Expand Down

0 comments on commit b27894e

Please sign in to comment.