ChatGPT's Code Interpreter is Absolutely Mind-Blowing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what is going on guys welcome back in this video today I want to show you how impressive the capabilities of gpt4 together with the code interpreter are and what you can do with it so let us get right into it [Music] all right so we're going to explore the chat GPT code interpreter functionality in this Village day and my goal is to show you a couple of examples and use cases to show you how much more we can do with chat GPT just because of this one extra feature the code interpreter now what you need to know is that the code interpreter is only available for chat GPT plus users it can only be used with chat gpt4 or with gpt4 not with GPT 3.5 so if you don't have chat GPT plus you will not be able to try this yourself at least yet but you can still watch this video to see what's possible and to get inspired and to get updated and if you have this if you have chat GPT plus what you need to do is you need to First enable this feature so you can open up the sidebar you can go down here to the three dots you can click on settings and beta you can click on beta features and then you need to enable the code interpreter once you have done that you can hover over gpt4 and you have to select the code interpreter to enable the feature you can see it's currently in a beta phase but it already Works quite well and the first thing thank you that you probably notice here is that you get this extra plus here and this is as you can read here for uploading files and this is already super super interesting what we can do now with this code interpreter is we can provide files and we can also get files from it so we can upload a file and we can tell it to do something with that file and we can also get a file as a result that we can download but we're going to start first of all here with a simple request with a simple example which is just sorting a list of numbers so let's say here here is my list of numbers um and I'm going to provide just the basic list now 10 19 2 3 14 13 16 2 2 1 18 19 0 11. and I'm gonna say sort this list using a bubble sort algorithm and return the result to me and when I send this now it's not just going to write python code for me you can see it's working and it doesn't show me even The Code by default but I can click on it on show work here and you can see what it's actually doing is it's writing python code so it says numbers equals whatever then it writes a bubble sort algorithm then it sorts the numbers it Returns the sorted numbers I get the result but I can also hide the work so that I don't see what is happening behind the scenes and you can see that the result is just the sorted list using the bubble sort algorithm is this so this is useful for both programmers and non-programmers because the programmers can actually look at the code see that it works also get the result and also get the process whereas the non-programmers can just say this is my task do it and they can just end up with a result now this is a very very simple example let's try to do something uh more complicated let's go ahead in pycharm here create a new python file I'm going to call this main.py and what I'm going to do now is so I'm going to just download stock data because one thing the chat GPT cannot do and also the code interpreter cannot do is download files from the internet it cannot send requests it cannot do any requests so we're going to just use the Y Finance module and you don't have to do this you can also just download the CSV file from somewhere else I'm going to do this with python I'm going to say import y Finance as YF and if you don't have the module just pip or pip reinstall why Finance uh and I'm just going to say data equals why Finance ticker let's go for Microsoft and I'm gonna get the history period is gonna be one year and I'm gonna get all this data and I'm gonna put this data into a CSV file so to CSV I'm gonna say stock or let's call it msft stock data dot csb for example now I can run this this is executed I have my stock data Here and Now what I can do is I can go to chatgpt with a code interpreter plugin and I can click on upload file I can take this Microsoft stock data here and I can say this is some Microsoft stock data um over the last year or maybe not some but this is the Microsoft stock data over the last year please visualize it as a Candlestick chart using matplotlib now I think I assume that what it's going to try to do it's going to try to use some libraries that are not present in the code interpreter because the code interpreter doesn't have access to all the python packages of course also because everyone can upload a python package and then uh you're going to um if everyone can upload a python package to pip and then you can install any package you can just hack into chat GPT which is not good so we don't want to do that and because of that it's limited to some libraries so if it tries to use here let's see yeah it tries to use MPL Finance I think this is not available so we're going to run into an error here but we can fix that what you can see here first though is it loads this data set into pandas it reads the pandas data frame and it shows the column so that it knows what the data set looks like so what it actually does here is it explores the data set that I provided it with so you can see here it says MPL Finance is not available in the current environment then it tries to do plotly it says it's also not available so what I'm going to do is I say is I'm gonna say um don't use any fancy packages just use core matplotlib and Design the candle stick chart manually like this so then it will rely only on matplotlib and it will basically manually create a Candlestick chart so we can look at the code here and the code generation is not the impressive thing because of course we were able to generate code already but it also can execute that code and it can also and this is the interesting thing here it can do data set exploration so it doesn't have to rely on your input what's the problem here now um okay it already fixes the errors itself this is the good thing now first of all it can do data set exploration so it can look at the data and determine itself uh what it can do with the data or what it should do with the data and the second thing is it can fix it on its own mistake so here you can see it gets an attribute error it says okay this is an error I get some problem here and it gets another error it gets another error and it tries to constantly fix this now I'm not sure if it's going to succeed here if it doesn't succeed here I can show you an example from yesterday where it did succeed where I did the exact same thing I uploaded the stock price and I told it to manually plot a Candlestick chart and it succeeded now again I don't know if this is going to work this time uh but if it doesn't work I'm going to show you an example from yesterday so what it does here is there you go it actually worked now the date it doesn't look too good and we could of course adjust this here so we can say okay the date column or or the the x-axis looks quite messy please change that and it would adjust that but you can see it produced a Candlestick chart for a given data set so I don't even have to look at the code so someone who is not into coding what they would have done here now the only thing that I did here is I mentioned that I want to use Core math but maybe the non-programmer doesn't know how to specify this but I actually just passed stock data and I got a Candlestick chart that's basically what I did now let's go ahead start a new thread here and uh what I want to show you here is I want to create a create an image for example some fractal art and I want to get the image from chat GPT so let's go ahead and say uh generate a fractal um a fractal pattern image using Python and provide me with a download link for the result and then it tells me something about fractals about the mandelbrot uh set and uh yes I want you to do that so now it basically does the math to generate this set and this fractal pattern uh it writes the code and then once all of this is done once all this is executed it's going to save the image into a file and it's going to provide a download link to that file so you can see here it has some it's it's obviously running on uh I think Linux I don't know if Unix based systems like mac also have Mount uh but yeah this is first of all the result and we can also download the image from this link here so I can just click on download and it's going to download the image this is quite impressive as well so you can actually see results and it also again as I mentioned fixes its own mistakes now one thing that I want to show you here and I don't know if this is going to work the same way that it did when I tested this but this is scary if you remember a couple of um days ago or maybe a couple of weeks ago I uploaded a video on income prediction with python where I loaded the data set and I trained a random Forest classifier to classify um the the income levels of people now what I can do here is I can actually upload that data set so I can actually upload the income CSV data set here that we used in the video and I can specify what I want to do use this data set or maybe pre-process this data set and train a random Forest classification model on it uh to predict people's income so this is my prop now I don't know if this is going to work as well as it did um a couple of days ago when I tested this but this is interesting because what this does now is basically chat GPT goes through the full data science cycle and machine learning cycle so what it does here is first of all it loads the data it displays the data so that it can see okay what do we actually have here and we have certain categorical attributes we have certain numerical attributes we have a Target attribute it sees all of this and it says what do we need to do so let's first of all handle missing values and it can see here we have some missing values it looks like some of them are missing here it says how it handles the values it says for the work class occupation columns we can fill the missing values with the most frequent values since there are categorical variables for the native country column we can also fill values with the most frequent category then it does that um and it also what does it do here it also does already the encoding it also does um the label encoding already um now it splits the data into training and testing now this is actually not that good because I had an example where it did it in a better way because right now it took categorical attributes and it did label encoding on them this is not good you usually want to do one hot encoding but you can see the accuracy is still quite good I want to show you the example that I did a couple of uh days ago here let me just find it was it was it this one um oh actually here I only did the pre-processing but it's still it's still quite good because uh this is an example where I did the pre-processing I uploaded the income CSV data set pre-process the data set so that that I can use it for a random Force classifier later on then it exported data it handled the missing values and here it made the right decision because what it did was um it replaced or it it identified the categorical variables and it did one hot encoding on them and for the income encoding uh for for the income column it did label encoding as you can see so we'll perform one hot encoding on the nominal categorical variables and label encoding on the target variable and then it encoded it and I said no just give me the pre-process CSV because it wanted to split into training and testing I just said give me the pre-processed data set and I was able now the session expired here but I was able to get this pre-process data set as a CSV file as a result so you can only use it for pre-processing or you can go through the full cycle here with a random Force classified to actually give you the model and the accuracy and everything like that now maybe I can say here I'm not sure if this works can you save or export the model so that I can use it and then it probably is going to serialize that so yeah it exports this as a job lip okay so now I can download the random forest model and I can also ask it how to load it and stuff like that so this is very very useful now the last example that I want to show you here is uh quite interesting I can upload an image here and you can also do the same thing with videos you can upload a video and tell it to cut out certain pieces depending on uh certain criteria so that it does it with movie Pi but uh what I want to do here is I have this image of faces so just a couple of people and I want to say how many faces are present in this image and I can send this and this now basically will write python code to do face recognition or face detection so you can see here it shows the image first of all this is the image that we passed just a couple of people here and now what it does is it uses face recognition actually I thought it will use uh the Cascade files let's see if this works okay it doesn't know that so it's going to switch to opencv which is what I thought it would do uh yeah this is what I thought it will do Cascade classifier so this is now going to apply this methodology and then we will get an image with the recognized faces imagery is not defined okay so it runs into a couple of mistakes but it can fix them itself probably so let's see there you go okay this is impressive you can see it gave me a result now we could argue that this is not a face we could argue that this whole thing is a face and then this one is a phase as well but you can see it recognized those four faces and already plotted a rectangle around them or a square around them and gave me a result this is super impressive because again as someone who doesn't code I didn't have to do anything so if I don't know how to code I basically just pass the image faces jpeg how many faces are present yes it made some mistakes but I don't care about them at the end of the day I didn't do anything and I got this result this is super impressive and you can do much much more with a code interpreter so that's it for today's video I hope you enjoyed it and hope you learned something if so let me know by hitting a like button and leaving a comment in the comment section down below and of course don't forget to subscribe to this Channel and hit the notification Bell to not miss a single future video for free other than that thank you much for watching see you in the next video and bye
Info
Channel: NeuralNine
Views: 20,292
Rating: undefined out of 5
Keywords: chatgpt, gpt, gpt-4, gpt-3, gpt-3.5, code interpreter, chatgpt code interpreter, gpt code interpreter, gpt-4 code interpreter, gpt plugins, chatgpt plugins
Id: Hs_x36spL-k
Channel Id: undefined
Length: 16min 53sec (1013 seconds)
Published: Thu Aug 24 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.