|
| 1 | +# Setup Guide |
| 2 | + |
| 3 | +This guide will provide a step-by-step guide to make your machine ready to run Python with basic packages to get you started with machine learing. |
| 4 | + |
| 5 | +## Installing Python |
| 6 | + |
| 7 | +[Download PyCharm](https://www.jetbrains.com/pycharm/download/) (community version). It is one of the widely used IDE for Python and would make coding easier. |
| 8 | + |
| 9 | +Install [HomeBrew](https://brew.sh/) a package manager for Mac OS by running the following commands in the terminal. |
| 10 | +```bash |
| 11 | +xcode-select --install |
| 12 | +``` |
| 13 | +```bash |
| 14 | +ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
| 15 | +``` |
| 16 | + |
| 17 | +Ensure Brew is correctly installed by running the following command. |
| 18 | + |
| 19 | +```bash |
| 20 | +brew doctor |
| 21 | +``` |
| 22 | + |
| 23 | +Install Python 3.7 by running the following command. |
| 24 | + |
| 25 | +```bash |
| 26 | +brew install python3 |
| 27 | +``` |
| 28 | + |
| 29 | +After the installation check the version of the python and also its installation directory. |
| 30 | + |
| 31 | +```bash |
| 32 | +python3 --version |
| 33 | +which python3 |
| 34 | +``` |
| 35 | + |
| 36 | +The ouput of the directory should be somethhing like "/usr/local/bin/python3.7" or "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7" |
| 37 | + |
| 38 | +## Getting Started |
| 39 | + |
| 40 | +1. Start a new project in PyCharm. And push the dropdown of "Project Interpreter". |
| 41 | +2. Choose the option of "New environment using Virtualenv" and check that the version of the "Base interpreter" is Python3.7. Check your project directory and click "Create". [Virtualenv](https://www.pythonforbeginners.com/basics/how-to-use-python-virtualenv) allows us to have a seprate environment for each project which allows for smooth development. |
| 42 | +3. Create a new Python file either from the File menu or by right-clicking the project folder in the left widget. |
| 43 | +4. Let's run a simple code to understand how to run and view output. |
| 44 | +```python |
| 45 | +if __name__ == '__main__': |
| 46 | + a = "This is a string." |
| 47 | + b = 10 |
| 48 | + c = 55 |
| 49 | + result = b + c |
| 50 | + print ("Hello World") |
| 51 | + print ("The sum of two numbers: {}".format(result)) |
| 52 | +``` |
| 53 | +5. To run the above program either click the small green triangle besides the "if \_\_name\_\_ == '\_\_main\_\_':" or run the program from the Run menu. |
| 54 | +6. Feel free to explore some of the basic Python tutorials by clicking [here](https://www.datacamp.com/courses/intro-to-python-for-data-science). |
| 55 | + |
| 56 | + |
| 57 | +## Solving our first ML Problem |
| 58 | +We are gonna work on our first dataset by using simple [linear regression](http://onlinestatbook.com/2/regression/intro.html). We would be using a fairly small dataset for our problem called [Auto MPG](https://archive.ics.uci.edu/ml/datasets/auto+mpg). |
| 59 | + |
| 60 | +## License |
| 61 | +This guide is free to use for non-commercial purposes. For any improvements please reach out to me on: bhanu93(dot)iitd(at)gmail(dot)com. |
0 commit comments