How to use ChatGPT Code Interpreter - 6 Main Functions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it can read and execute python code sent to it the result of the execution can be returned and interpreted by chargeivity it executes the code immediately after it is sent it doesn't compile the entire program at once but executes each command as it is received The Interpreter is a platform independent as it runs on the cloud and it can be accessed and used from any platform since it's a python interpreter it supports Dynamic typing it does not have internet access which means it cannot make external web requests or API calls they will fail another limitation is that it doesn't have all python libraries however it has numpy pandas and matplotlib which makes it powerful already and there's so many more now our limitation is that very long running operations may not be suitable for this environment because there are time limits on the execution of code also the resources such as memory and CPU available in this environment are limited therefore it may not be suitable for a high performance or resource intensive computations in this video I'm going to show you the six main functionalities of code interpreter and what are its limitations you have many available libraries such as matplotlib or Seaborn but it's not connected to the internet so you still have to import your data set which is pretty easy and I'm gonna show you how now we're gonna fetch some data from the data government from America because why not we're going to to most views and we're gonna go to crime data from 2020 because why not you just gotta click here upload file obviously and just to save some time I'm gonna also already tell it two things that can work as a beginning of our exploratory analysis overall I do recommend you using couple of different functions at the same time because you only have 25 prompts per three hours and this can be limiting when you're working with a lot of data that's obviously you want to analyze it's gonna take its time to actually compute all of this again because our data set is very large you can check what it is doing and then at the end it's gonna give you a pretty detailed overview of everything happening in your data because code interpreter is using python you can use Library such as Panda to pre-process data you can handle missing values you can sort them you can replace them I'm going to show you real quick some of those functions I already know that I'm having some missing data here but let me just show you some instructions and how you can communicate with this the best part about this integration is that you don't have to write the code yes you can and if you do so it will actually be better so here is a good time to mention that if you have an expertise in using python in data analysis this will be much more useful to you but if you don't you can just use normal language chagibiti will handle your requests and it will still execute it's going to give you an exact overview of what is missing in your data how many values are missing and it can even tell you methods to handle this the best part is that it specifies the methods to your data set so let's say we like this one we can just copy paste it and ability to perform it and to happily do that it will report what it did and what it is due to be done data visualization is one of the best functions here because it can do anything that you can think of as a data analysis and if you don't know how to think of you can actually ask it to give you appropriate suggestions for visualization of your data given your data but let's say you have an idea we're going to ask you to analyze the distribution of crime incidents over time such as monthly weekly or hourly patterns to identify any significant Trends and it is pretty good at what it's doing look at all this code and all of those functions that you otherwise would have had to do manually now the actual graphs are very well done I've always hated having to actually design my graphs I was using R before because I was doing a PhD where I had to visualize any information and then I had to go back and actually describe my graphs that was such a tedious work for me well code interpreter is better at least better than me besides the actual graphs you can see the report which is already doing everything that usually you have to write down let's do one more thing group the crime incidents by month and calculate the frequency of crimes for each month and it will obviously do that let's do a heat map of the correlation Matrix of the data set that is so beautiful it doesn't take a lot of time to do this in r as well but the time you take to clear your data and just prepare your data to get to this and then you still the code you have to write it is time consuming it also gives you again an analysis obviously our correlation it's not very useful for the current data set but nevertheless showing capability and let's now create a bar chart for the top 10 most common types of crime and why not align plot to visualize the monthly distribution of crime incidents all right people are stealing cars in Los Angeles and what I see from this is that right after December maybe Christmas people are like I don't have money anymore I'm gonna go steal something sorry for my interpretations but it's just obviously you can sort your data filter it aggregate it merge it let me show you we want to filter rows where the crime type is well we're gonna copy paste from here because why not and then we want to also sort the data set by the date column we're gonna give the order that we want and why not calculate the total number of crimes by crime type it's gonna take a bit of time to do all those three things but here we go you can also see what it did exactly and then just obviously read your report python sci-fi library is available in the environment which means you can do various of statistic analysis like Anova regression linear and logistic regression you can do hypothesis testing however there are limitations when your data is very large and I'm gonna show you how this works in the next step yes you can use code interpreter to build and train your machine learning models however training complex models will be limited because of resource constraints such as memory and CPU also in this section I'm gonna show you why if you are not an expert in the field you can still achieve a lot however if you are an expert that think it's gonna really speed up your performance all right we're gonna tell it that now we are going to build and drain a machine learning model the first step is always to prepare the features and Target variables here I'm gonna make two mistakes to test its functionality first I'm gonna give it a variable that doesn't exist in my data set to see if it's going to hallucinate because you know charge EBT can do that second I'm gonna ask you to do something that actually cannot be done and see again if it's going to try to work it out or instead it's gonna reason with me and it's gonna tell me that it's wrong well it didn't hallucinate and it didn't try to make up something it told me what it should to have so pretty good now let's say you're not an expert you have no idea how to proceed tell it suggest the best variables to use given what I want to achieve it's going to give you a couple of options you're gonna select what you want you're gonna tell it that you like this scenario then you're gonna repeat the first instruction but you're gonna add one more instruction here because we want to be efficient with our prompts Step 2 of machine learning model is always to split the data into training and testing sets now there was a new problem and this time it already solved the problem before even asking me because it was determined to follow my instructions and get me the results now our data is successfully prepared and split into training and testing sets here are the results it's gonna tell me the next steps which obviously are building and training my machine learning model it's gonna ask me if I need assistance of course I do I'm gonna tell it to choose a machine learning algorithm because this is very important part of this and then obviously train the model and make predictions on the testing data making predictions it's actually evaluating your model meaning you have to know whether this model will work with new data meaning if you train it on the data set you want it to work with data that hasn't been seen before by your model and actually make accurate predictions now it tells me to use a random Forest classifier it explains to me why that is pretty okay however you're gonna see the problem now as I told you before our data set is large in making computations to train your algorithms it's not something that just happens in five minutes here we go we have memory error it does tell me a couple of solutions that I can use let's say you want to think about a simple model and you're thinking about logistic regression model okay it's still not gonna work because we're still talking about complex computations in a large data set it's going to give you another solution I'm gonna agree with it just to see what it does and once again it's gonna happen it's gonna ask me to down sample my data yeah we can do that but there's a reason why we need a large data set for machine learning like it's the point of it it cannot learn it cannot predict well on small data sets so yes for the exercise to show you how code interpreter works we will continue but the main message here actually is that you can use this to learn the steps to learn different algorithms there are pros and cons and just to learn how the whole thing works but then you have to use it outside because this so far thankfully cannot handle everything because if it could I think the title of that video would have been confirmed it's pretty good that you don't have to be careful about typos because I didn't need that s there and okay and here we go we have successfully trained our model however it is accurate about six percent of the time which means in our case it can predict the hour of crime occurrence about six percent of the time it does give you valid explanations for why you have a poor performance you can again use this with educational purposes and go back to your data and work it out in case you're working with real-time data and this is something that you are encountering such as low prediction rate I hope this video gave you a good overview of the functionality of code interpreter with chargpt yes it's very powerful and eliminates the initial first steps of learning if you are not a data analysis already or for professionals it eliminates the tedious work where you don't want to waste your time on clearing your data or sorting your data instead you can focus on the creative part it can really help you create something bank and focus on the important parts of your work instead of wasting time with worrying tasks if that video helped you you know what to do and I'm gonna see in the next video bye
Info
Channel: Team Up With AI
Views: 1,143
Rating: undefined out of 5
Keywords: chatgpt, large language models, how to use ai, artificial intelligence, openai, code interpreter
Id: 2cm1ijkDFEI
Channel Id: undefined
Length: 11min 55sec (715 seconds)
Published: Wed Jul 12 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.