handson-ml2 icon indicating copy to clipboard operation
handson-ml2 copied to clipboard

[Chapter 2, P.42] - Creating Workspace Directory, not working for Windows?

Open MathStat1 opened this issue 4 years ago • 2 comments

In p.42, the following is to be done according to the book:

image

I think this is for Linux, but I am using Windows. Can you provide what to write when using the CMD in Windows?

Also, in general explain little bit more what it does since I have no real background in Computer Science.

Thanks.

MathStat1 avatar Aug 02 '21 14:08 MathStat1

That works fine in Git Bash. Broaden speaking the first line creates a variable "ML_PATH" to represent $HOME/ml and then saying to create that folder (ml), you could also go straightfoward just typing $mkdir -p ml. I think Geron created that variable just in case you don't want to assign your user directory (perhaps you find better to assign your HD's directory ,D:/ml for instance)

Duca2020 avatar Aug 07 '21 23:08 Duca2020

Hi @MathStat1 ,

As @Duca2020 wrote (thanks!), the goal is just to create a working directory in which we'll put the project. You could just create it manually using your file explorer, if you prefer. The command export creates an environment variable. Here we're just creating an environment variable that we choose to call ML_PATH, and we set it to the value of the HOME environment variable (that's what $HOME means) followed by /ml. On linux and MacOSX, the HOME environment variable automatically points to the user's home directory, for example mine on MacOSX is /Users/ageron (on Linux it would typically be /home/ageron). So the ML_PATH variable will be equal to /Users/ageron/ml on my system. Next, we use mkdir to create this directory. The -p option creates all parent directories if needed. For example, if I decide to point ML_PATH to /Users/ageron/a/b/ml, it will automatically create the directories /Users/ageron/a, /Users/ageron/a/b and /Users/ageron/a/b/ml.

Windows has equivalent commands. Instead of export ML_PATH="$HOME/ml", you must use set ML_PATH="%HOMEDRIVE%%HOMEPATH%\ml", and instead of mkdir -p $ML_PATH you should use md %ML_PATH%.

This should get you started. I recommend looking into other terminal commands (like dir and others), they're quite useful.

Hope this helps.

ageron avatar Aug 17 '21 01:08 ageron