3 Must Know VS Code Features for ML & Data Science!
9:05

3 Must Know VS Code Features for ML & Data Science!

AssemblyAI 06.08.2022 14 209 просмотров 341 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
3 Must Know VS Code Features for ML & Data Science! Get your Free Token for AssemblyAI Speech-To-Text API 👇https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_pat_53 ▬▬▬▬▬▬▬▬▬▬▬▬ CONNECT ▬▬▬▬▬▬▬▬▬▬▬▬ 🖥️ Website: https://www.assemblyai.com 🐦 Twitter: https://twitter.com/AssemblyAI 🦾 Discord: https://discord.gg/Cd8MyVJAXd ▶️ Subscribe: https://www.youtube.com/c/AssemblyAI?sub_confirmation=1 🔥 We're hiring! Check our open roles: https://www.assemblyai.com/careers ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ #MachineLearning #DeepLearning #VsCode

Оглавление (6 сегментов)

<Untitled Chapter 1>

hi everyone i'm patrick and today i show you three of my favorite vs code features that lets you develop python apps and especially machine learning deep learning and data science apps like a pro believe me this will make your work environment so much easier especially the last tip so without further ado let's jump right into it the first feature is the integrated

Integrated Two-Parter Notebook Support

two-parter notebook support so one thing we can of course always do is use a google collab these are amazing but often we also want to develop on our local machine and for this we could spin up the classic two-parter notebook server and use this but let's be honest it doesn't look beautiful and it's also not the best developer experience so i'd much rather have this inside vs code on my local machine and what is really cool is that it has built in support so we can simply create a file with the ending i pi and b and now this is recognized as notebook and we can use this we can here select our environment in this case i want to use my machine learning conda environment and the only thing we have to do for this is have the python extension installed and we also have to install a two fighter kernel inside this environment but if this is not yet the case then it will show you a prompt and you can easily set this up so now we can start coding in the cell and say import numpy snp and as you can see we get auto completions and suggestions so all the great features that we are used to from our ide then we can run the cell and insert a new one we can also insert a markdown cell so all the normal node notebook features we can also connect to a remote server by saying command shift p and open the command palette and then we search for two pointer and select this one and then we can specify a host name if we have one so this is super cool and i recommend trying this out inside vs code and this is feature number one feature number two is the

Two Is the Python Interactive Mode

python interactive mode in vs code and a lot of people don't know about this but it's actually an awesome feature so often i don't want to use a two-pointer notebook but rather a normal python script but then i still want to have interactive features to play around with this and test this and we can get this by using a special comment with two percent signs and now we as code will interpret this as a special cell similar to a notebook cell and then here for example we can insert more comments to make more separate cells and then we can click on run cell and now this will open an interactive window then for example let's run the next cell and here we can play around with this for example here i can type code like in a terminal for example i want to display the data frame so i can say command shift and run this i can also create new variables if i need them and then let's also run the last cell so we can also render the plots here then we can also click on variables and inspect all the variables that we have during the session and then for example for the data frame we can click on this button and open a data viewer so here we

Data Viewer

can analyze our pandas data frame for example we can change the sorting according to the columns and yeah simply this is simply helpful to analyze your data frame and then we can also debug a cell for example here we can click on debug and now we can step over the code just like in a normal debugger and inspect our local variables so this is also super helpful sometimes so yeah i recommend just playing around with these interactive cells by using this comment and let me know if you also find this helpful and this is feature number two and the third feature is really a game changer for your development environment

Remote Development with Vs Code

and this is remote development with vs code this extension includes remote containers remote ssh and remote wsl and with this we can connect to a docker container a remote machine or the windows subsystem for linux we can also combine this and can connect to a docker container on a remote machine and then we can create our coding environment inside a docker container and open vs code there and start coding so in the docker container we specify all the dependencies all the cuda drivers for example and all the libraries we need for our project for example tensorflow python scikit-learn whatever and then we can simply set this up once and connect to the container open this code and start coding inside this environment and also all your team members can use the same container and have the very same coding environment so this is really a game changer for your projects and now let me show you how to connect to a docker container with vs code now to get started i recommend checking out these guides for ssh for a container and also for remote docker over ssh and then the way it works is that on our own computer we have vs code and the remote extension and then inside the container we define how this container looks like and then here we can run the application and also use a debugger for example and then inside the container we also open up vs code and then we have to mount the code so we can either copy this from our machine or we can clone it for example from github and to get started of course you have to have docker installed on your machine and then i also recommend installing the docker extension and then after installing the remote extensions in the lower left you find this button and here you have different options for example you can connect to a remote host or we can attach to a running container and the simplest way to get started is click on try a development container sample and then select python and now this will open a remote connection to a container so now we are inside this container so here we have all the starter code we also have the terminal inside this container and then for example in this example it has the requirements flask and it has a simple flask app you can also inspect the docker file if you want to see how this is set up and now to get started you find the command in the readme so we say python and flask run and now if we start this then we can even open this in our browser on our machine so this works and now we can start coding here or debugging here or whatever so yeah this is the simplest way how to get started and now let me also show you how to define our own

Docker Containers

docker containers so here let's close this remote connection and this and to get started we have to define a docker file where we want to specify how this docker container looks like so here we use a base image and there are different ones available in the docker hub that you can use for example for tensorflow pytorch cuda also at nvidia there are optimized docker containers for example for tensorflow or pytorch that you can use with these instructions so yeah this is worth checking out in our case i start with a simple python base image where i want to copy the requirements and in this case it only has psychic learn and then we say pip install the requirements and then when we have this we have to build the image so we say docker build minus t and give it a name i already did this so this image is now available and now we can select the docker extension and see the images so in this case this one then we can start the container and now when this is started we can say attach shell or attach visual studio code and now this will open a connection to the container and then inside the container we have the requirements file that we copied and then i already created this by hand before so i created a file here and this was cached so this is still here and then we can for example import scikit-learn and build our model and then we can say python main dot pi and by the way if we simply select python then we see this is python 9 because we used a python 9 image so now we say python main. pi and now this is executing the code with this library that we want so this is how to work in a docker container with vs code and yeah these are all the features that i wanted to show you in this video i hope this was helpful to you let me know what you think about these features and if you also have another recommendation for vs code and then i hope to see you in the next video bye

Другие видео автора — AssemblyAI

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник