Skip to content
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
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ If you feel this book is for you, get your [copy](https://www.amazon.com/dp/1800
<a href="https://www.packtpub.com/?utm_source=github&utm_medium=banner&utm_campaign=GitHubBanner"><img src="https://raw.githubusercontent.com/PacktPublishing/GitHub/master/GitHub.png"
alt="https://www.packtpub.com/" border="5" /></a>

## Errata
Page 16

The expression nt.to.numpy.matrix(G) should be nx.to.numpy.matrix(G)

## Instructions and Navigations
All of the code is organized into folders. For example, Chapter02.
Expand All @@ -44,6 +40,15 @@ generator = HinSAGENodeGenerator(
head_node_type="document"
)
```

The notebooks in the repositories save files and figures into dedicated folders as they are executed. The format for these folders are:

```
<DATA_FOLDER>/Chapter<n>
```

where `DATA_FOLDER` is an environment variable that you can use to customize the position for the data. If the variable is not set, its value fall back to `<root_folder_repo>/data`.

**Following is what you need for this book:**
This book is for data analysts, graph developers, graph analysts, and graph professionals who want to leverage the information embedded in the connections and relations between data points to boost their analysis and model performance. The book will also be useful for data scientists and machine learning developers who want to build ML-driven graph databases. A beginner-level understanding of graph databases and graph data is required. Intermediate-level working knowledge of Python programming and machine learning is also expected to make the most out of this book.

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ USER ${user}
ENV HOME /home/${user}
ENV NB_USER=${user}
ENV XDG_CACHE_HOME=/home/${user}/.cache/
ENV DATA_FOLDER=/data

RUN git clone https://github.com/deusebio/Graph-Machine-Learning.git /home/${user}/Graph-Machine-Learning
WORKDIR /home/${user}/Graph-Machine-Learning
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ $ docker run --rm \
graph-machine-learning:latest
```

to start the image. We suggest to use the default port 8888 for the `<port>`. This will start a Jupyter server which should be locally accessible at `[http://localhost:8888](http://localhost:8888)` (or change the port accordingly).
to start the image. Please make sure that the data folder can be written by the Docker image. We suggest to use the default port 8888 for the `<port>`. This will start a Jupyter server which should be locally accessible at `[http://localhost:8888](http://localhost:8888)` (or change the port accordingly).

## For Developers

Expand Down
9 changes: 7 additions & 2 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

_chapter = os.path.basename(os.getcwd())

DATA_DIR = pathlib.Path("/") / "data" / _chapter
if _chapter.startswith("Chapter"):
BASE_FOLDER = os.environ.get("DATA_FOLDER", os.path.join(os.getcwd(), "..", "data"))
DATA_DIR = pathlib.Path(BASE_FOLDER) / _chapter
else:
BASE_FOLDER = os.environ.get("DATA_FOLDER", os.getcwd())
DATA_DIR = pathlib.Path(BASE_FOLDER)

FIGURES_DIR = DATA_DIR / "figures"

Expand Down Expand Up @@ -65,4 +70,4 @@ def draw_enhanced_path(G, path_to_enhance, node_names={}, filename=None, layout
axis.set_ylim([1.2*y for y in axis.get_ylim()])

if filename:
plt.savefig(FIGURES_DIR / filename, format="png")
plt.savefig(FIGURES_DIR / filename, format="png")