Flight Price Prediction in Python - Full Machine Learning Project
Key Takeaways
This video demonstrates a full machine learning project using Python to predict flight prices based on various features such as airline, departure time, arrival time, and more, utilizing tools like Pieces, Jupyter Notebook, and scikit-learn.
Full Transcript
what is going on guys welcome back in this video today we're going to go through a full data science SL machine learning process to predict flight prices so we're going to train regression models to predict flight prices based on information like the airline the departure time the arrival time flight duration and more so let us get right into [Music] it all right so we're going to use regression to predict flight prices in this video today and this is going to be as I mentioned a full machine learning process so we're going to do exploration pre-processing train test splitting training evaluating and even hyperparameter tuning so this is a perfect video for those of you guys who want to actually practice machine learning Concepts using a Hands-On example uh and what we're going to do in this video is we're going to work with the flight price prediction data set from kagle you will find a link to it in the description down below all you have to do is you have to log into kaggle download the data set and the file that's important to us is going to be the clean data set CSV file so we can double click it and you can already see we have some columns that definitely need to be pre-processed because most features as you can see are not numerical we have stuff like uh the airline and Source City and stops and so on uh and then we also have the target variable the price which is what we're trying to predict with our regression models so this is what we're going to be working with now what's special about this video today is that we're going to be integrating a tool called pieces into our workflow and into our process and pieces is essentially an AI workflow co-pilot they're sponsoring this video today uh you can go to the website you will find a link in the description Down Below in a nutshell as I said there are an AI workflow co-pilot with horizontal integration which means it integrates into multiple different tools at multiple stages in your workflow you can have it as a browser extension you can have it as a Jupiter laap extension uh you can have it in py charm and vs code you can have it as a desktop application and I'm going to Showcase a couple of features of pieces as we go through this video as we go through the process of this machine learning project with a focus on the Jupiter lab extension but let me just briefly show you what pieces can do so that you have an idea of what this tool is it's completely free you can download it and you can work uh also with pieces as we go through this tutorial even though of course it's not mandatory you can also follow along uh normally basically on Linux what you can do is you can just use snap to install it so on deban based distributions pseudo snap and install pieces OS uh then also pieces for developers so pieces OS is basically the runtime pieces for developers is uh the desktop application then you can run both and then you can also install the browser extension Jupiter lab extension whatever uh in the case of the Jupiter lab extension you just have to go pip or pip 3 install Jupiter uncore pieces and once you have that you just have to run pieces OS on your system the runtime and then everything can connect so psos is running as you can see and let me just show you one simple use case and then we're going to explore more features as we go on let's say I want to go to stack Overflow and see how to flatten a list so stack Overflow flatten list off lists this is something I want to do uh now what I can do is here on the website I can enable my pieces um add-on in the browser and you can see that underneath every code sample I have this copy and say button which basically takes this and turns it into a piece in my pieces uh application so I have this flatten list uh code I can just copy and save and since this is integrated into my jupyter notebook environment as well I can just go to the pieces add-on here and I can click on the snippet that I just copy pasted now and then basically I can just copy and paste it here that's one simple use case what I can also do is I can use the desktop um application p pieces for developers to see all my pieces that I have gathered over time uh I can ask the co-pilot to tell me something about it so I can start a conversation with an llm and I can say what does this code do I mean actually it already tells me what the code does but I can say where would I use this if I have some questions and the good thing about this is that pieces is local first it uh respects your privacy it's secure and all the user data is stored on your device you can even even use on device llms but you can also connect it to uh stuff like GPT so this is like the basic idea of pieces you have this AI assistant you have these code Snippets and you can manage them across multiple environments uh and as I said they're sponsoring this video which is why they're included here and we're going to explore some features we're going to use uh pieces a little bit as we go through this process here so let us get started with the actual project so as we saw we have this CSV file and we have these different columns that definitely need to be pre-processed so we're going to start by importing pandas aspd now maybe we should first install the packages that we need for this video today and these packages are going to be of course pandas uh numpy Matt plot lip and sklearn or scikit-learn I think that should be all otherwise we're going to install additional packages as we go but the important thing first of all is to load the data set into Panda so we're going to say DF equals PD read CSV and we're going to read the clean data set CSV file so this is going to just load our data frame um or load our CSV file into a data frame then we can just look at it and we see that we definitely have a column that we don't need the unnamed column we have an airline that we probably want to use but it's a categorical feature obviously and we cannot use it just as uh simple strings we have the flight which should be irrelevant now maybe certain aspects of that flight like maybe the leading characters could be interesting but overall I think about dropping this feature uh Source city is probably going to be relevant uh destination city is going to be relevant departure time and arrival time are definitely going to be relevant you can also see these are categorical they're not specific time so it's not a numerical feature it's not an ordinal encoding that we need here it's a one hot encoding because we have these uh categorical features then for stops we have zero one and probably also other values we're going to have to explore this um but this definitely needs to be encoded numerically because this is uh a feature that can be on a numerical scale uh and then we have the class which is probably I assume this is going to be the most important feature uh and then also the flight duration and the days left could also be interesting because it basically says okay how many days ahead of time are you booking a flight and then we have have our Target variable which is price now what we want to do here is we want to get an idea of how many different values per feature we have so let's say for example the airline what kind of Airline values do I have how many are they do I want to encode all of them so let's go and say DF Airline and we're going to use the value counts function to actually get an idea of the different airlines and you can see we only have six different airlines and because of that it makes sense to encode all of them as a binary feature so to say is it this Airline yes or no is it this Airline yes or no which means we're going to one hot and code the features um now let's do the same thing for Source City and destination city so we're going to go and say DF Source City value counts and you can see we don't have too many values here we can go destination city value counts and also not too many cities here um so as long as we don't have too many values here we can just use one hot en coding if you have a feature with a thousand different values one hot en coding might not make a lot of sense especially not on all of them maybe then you want to pick the top five values or something but since we have a very limited amount of uh cities and a very limited amount or number of Airlines we can just one hot encode all of them uh or the whole feature so then we're going to also look at arrival time and departure time these should also not be super crazy so departure time value counts there you go and then also the same thing with the arrival time yeah so we don't have too many values here either uh what would be interesting now is to know how many stops how many different stops values we have so DF stops value counts because if it's just one and zero we could binary encode it but since it's one Z two or more we can do an ordinal encoding meaning it's one zero or actually Zer one and then two uh all right and then we're going to also look at class we're going to look at duration even though duration probably we can leave it as it is maybe we can scale it but we don't need to actually pre-process it uh like really pre-process it in terms of encoding it somehow because it's already numerical but let's go with the class I think we're not going to be able to do it like this because class is a python keyword so let's go class value counts and we only have two values which means that this is going to be a feature that we binary encode so we're going to make this a 01 feature not a I mean it's the same thing as making it uh a numerical feature in this case but it's not the same as encoding it one hot encoding it because one hot encoding it would mean we have an economy feature and a business feature and they can each be zero and one and in this case we're just going to say class is0 or one um all right so for the duration maybe it makes more sense to not look at specific values but at uh Min and Max or something like this uh so yeah we have value counts is probably not too interesting yeah so let's go with uh sum not sum sorry min okay this is the shortest flight then we have the longest flight and then we can go for something like a median value to know uh to to get a feeling of what a normal value is here 11 I think this is hours right I think so and for days left it's also a numerical feature so I don't think we need to encode it so what we're going to do in a nutshell here is we're going to drop this one we're going to one hot and one hot encode this one we're going to drop this one and basically one hot en code these and these we're going to turn this into a numerical feature from 0 to two we're going to turn this into a binary feature and we're going to leave these three SDR that's the plan for the pre-processing here and I hope you understand the reasoning behind this because we have these um these kinds of values here we don't have too many categories if we do a one hot en coding and I explained why we do a numerical here and a uh Bin re encoding here all right so we're going to start by uh by just doing what I just said so we're going to maybe let me use a markdown heading here so we have a section pre-processing because this above is just the exploration and now we're going into the pre-processing so we can say DF actually let's drop the features first so we're going to drop the unnamed zero feature on axis one then we're going to drop the what was it called uh flight feature as well and then we're going to do the simple binary encoding so class is going to be equal to DF class and we're going to apply a Lambda expression here so we're going to apply a function it takes some input X and it will return uh basically one if it's business so one if one if x equals business else zero so this will turn it into a binary feature uh and then we can do also something similar to uh or for the stops the thing about the stops is let me just see if it makes more sense maybe to use factorize so let's go with uh DF stops and then we're going to use or actually we're going to do PD factorize I don't use that function too often which is why I have some notes about it here so uh PD factorize DF stops I think this should work I'm just not sure if this is going to result in what I want because now or actually it works because 0 is z one is one or is it I'm not sure no I think the problem with this is that the scale is not correct uh or or the order is not correct because now I think 0 is zero uh two is one and then one is two which messes up the order because since this is a numerical feature the order is important because there's a progression between zero and two and there's the one in between so it means that the one is right in the middle so one should actually be one two should actually be two and so on which PD factorize does not do um at least not if we use it like this or actually I'm not sure if that's even the case let me just see if uh it's maybe it's correct so let's see DF stops we have 0 0 oh no actually it works I I just uh messed it up because the order here was 0 one2 and then I had zero and then uh one at the end but actually it's the correct mapping so this already should be enough to do uh a proper factorization so we can actually just go ahead and say DF stops or actually we can use DF do stops is equal to PD factorize DF stops um or actually this doesn't work why doesn't it work because we need to go index zero like this and then we can also run this and then we should already have some pre-process stuff here we have stops um and we have class as already encoded features we dropped unnamed and flight so the rest of them will be one hard encoded and in order to do one hard encoding in pandas directly we can just use the get dummies function so we can say here DF equals and we're going to join together the data frame that we already have so we're going to join the DF that already exists and we're going to join it with the dummies of the specific features now maybe so that you can understand this better what we're going to do is we're going to do PD get dummies onto a column so let's say for example the airline and what this will result in is we're going to have the airlines as individual columns that are all zero except for one and this is going to be the actual Airline so we're taking a categorical feature in splitting it up into uh in this case six different features that are all zero except for one which is the value that was the value in this particular row so what we can also do is we can add a prefix just so we have a better overview so prefix is going to be equal to Airline um and then we're going to have these column names and now we're going to join them with our data frame so DF join the data frame with the dummy and this is going to result in this and of course what we also want to do is we want to drop the a line then so we want to do drop Airline axis one so this is what it would look like and of course now we want to do the replacement so DF is actually this whole thing and we're going to do the same thing now for the different uh features so we're going to do the same thing with the source City come on where's the autocomplete okay doesn't give me an autocomplete Source City uh we can say source is going to be the prefix Source City and then um going to do the same thing with the destination city let's just go with Des here destination city um and then we can go with uh what was it arrival [Music] time arrival arrival time and then departure time departure time departure and departure time and do we have anything else I think that's it so we can just run this and our data frame will finally look like this we only have numerical and binary features left we don't have any features that are not uh either numerical or binary so we can feed all of this directly into uh a regression model and the price of course has to be treated as the yvalue as the target variable but you can see the pre-processing is now basically done so what we're going to do now is we're going to train uh a random Forest regressor so we're going to add a new section here we're going to call it training regression model and we're going to say that we want to have from sklearn do Ensemble we want to import a random Forest regressor so a random Forest regressor will be the model architecture or the model type that we use here and of course we need to also use from SK learn. model selection want to do a train test split so we want to use a train test split to split the data into to uh training data and testing data so that we can train a model and evaluate it with unseen data with unfamiliar data so X and Y is going to be equal to the data frame when we drop the price column so everything except the price is going to be part of X and Y is then also or Y is then going to be the price column um so yeah you can see the X values are these and the Y value is this so this is just uh the Y data the target variable and now we're going to do X train X test y train y test and we're going to do train test split XY with a test size of 0.2 So 20% of the data is going to be used as uh testing data 80% is going to be used for training um now what we can do here is we can um ask for example example now I'm I'm showing you a feature of uh pieces here again let's say I want to train now a regression model let's say I say Rec equals random Forest regressor um and I want to do Rec fit onto XT train and Y train maybe I have some uh some questions that I want to ask here so this here is the code I want to ask a question about I can just rightclick it and I can ask pieces about my selection so I can right click it and I can say how can I speed up this process question mark now of course I know the answer in this case but I'm just showing you showing you an example uh but basically I'm waiting for a specific uh section I think it mentioned it here somewhere utilize parallel processing I can set end jobs to a value greater than one now I can follow up and ask how can I get the max number of processors while I'm coding here I can ask and then I should uh okay actually it it shows me a different uh a different solution here you need to keep in mind though that this is of course uh GPT so it's not really pieces that's giving the answers here uh but the correct answer here would be and I would probably get it if I ask more often is I would get n jobs equals -1 to maximize uh the number of processors used now what I can also do is I can ask for example uh do I need to scale my data for this type of model and the correct answer would be no because there you go yeah you don't need to scale your data for a random Forest regressor so you can ask questions like these you can also by the way set some context now you can add files and code Snippets and folders and messages that are going to be considered when uh this assistant is giving answers to you so you can just upload files and get some uh responses here as well all right so we can just fit the model here and then once the training is done we can also evaluate it immediately we can say Rec score on the test data and on the uh on the X test data and on the Y test data and in this case I get uh 98.55% I mean it's not accuracy I think it's R squar so it's basic it works like accuracy because it's between and one and one is the perfect value uh but it's basically just the r squ um or the R2 I'm not sure what what the correct name is in English uh but that's the metric that we use here and we can see that the performance is pretty good now what we want to do though is we want to get some more metrics um we want to get some uh first of all we want to get some more metrics and then we also want to increase uh the performance of this model by doing hyperparameter tuning so what we're going to do is we're going to say from SK learn do uh metrics we're going to import the mean absolute error the mean squared error and the R2 score uh just to show you that this is actually the R2 score or squared score whatever uh and then we're also going to import math because we want to do some square root stuff here as well the reason you're you might be interested in a mean absolute error is because you want to know on average how much you deviate uh from the actual price in in actual dollars if if this is dollars I'm not sure but in actual currency and not some some abstract metric so what we can do here is we can say uh y predicted values given the test data is going to be equal to the regression model predicting making predictions on the test data and then we want to compare these predictions to the actual values and calculate different scores so the R2 score I'm just going to call it R2 now I think this is not wrong uh it's going to be the R2 score and then y test and Y predictions and you can see this is the same value here but now we can do the same thing with the mean absolute error with the mean squared error and also with the root mean squared error so rmse so here we just have to do mean absolute error mean squared error and here we need to also do mean squared error but we're going to go with a square root so math.sqrt before that there you go so this is um the thing that we can interpret on average our model uh makes a mistake or an error of 1,66 so it's actually not that small of a a mistake here but we can also visually see how close our predictions are to evaluate overall if our model performs well or not so we can go ahead and say import matplot lip. pyplot splt and then I can say PLT scatter and I can scatter the predictions against the actual values so I can say y test or the actual values against the predictions y test y prediction and then pltx label is going to be um actual values or actual flight price and then the Y label is going to be predicted flight price and then I can say PLT title and then prediction versus actual price and then if I run this you can see that our predictions sometimes are quite off but over overall if you look at these um these axes here we have a pretty uh tight not line really but the points are scattered around a line and they're not too far apart so the variance is not huge um which means that the model is performing decently we don't make some ridiculous predictions and I also think by the way that when I look at these values now that the price is probably not in dollars which means that if we go and say actually DF price uh and then actually can we do something like describe was it describe yeah there you go uh if you look at it the meme price is 20,000 the minimum price is this and the maximum price is this so actually a deviation uh in our predictions of a th000 if it was dollars it would probably be very horrible but I think this is uh some Indian currency here since these are uh Indian cities and in this case probably this is actually quite a small error that we're making here so our model is pretty strong um and you can see that here because as I said the points are quite uh close to one another or quite close to the line here that is running through the middle all right so let's go ahead and see also before we go to the hyperparameter tuning which kinds of features are the most relevant for this so what we can do for this again just to show you pieces is we can go and say uh sorted feature in importances random forest regressor and then I can get my extension here I can copy and save the snippet I can go to my Jupiter lab environment and I can uh I can just copy paste this here and of course we should look at the code to understand what it's doing uh because what we do here is we have an empty dictionary and then we it at over the feature importances that are already built into our regression model now we need to replace RF the random forest with our W model which is our actual model we iterate over these feature importances and then we add them to the dictionary um with index and value here so index being just the enumerate index and value being the actual feature importance and then we get our feature importances list which is the sorted dictionary where the key is the element that we get with get uh we sort it in reverse order and then we can print the most important features actually this is some pretty shitty code to be honest so I wanted to show you the feature but the code doesn't doesn't impress me a lot so I'm going to do it my way I'm going to say importances is equal to dictionary and we're going to zip the feature names with the feature importances and then we're going to just get to sorted importances by saying sorted uh not sorted importances sorted and then importances items key is going to be a Lambda expression where we get X X1 and reverse is going to be true and then we can print these sorted importances there you go uh and of course we can also go ahead and save the active cell to Pieces so I can go and I can save this to pieces and now I have my own snippet that I can use later on so if I ever have to do the same thing I can just go here and I can copy paste this snippet to get my feature importances because that uh from stack Overflow I did not like that so I can just uh find my own solution and save it for future work by just clicking this button saving into Snippets there you go um yeah so as you can see the most important feature by far is the class so I think this was predictable business eon is going to going to be a huge difference also the duration is very important and when you book the flight one day before uh or you know 10 months before probably I'm not sure what the the range here is but did we actually look at that did we look at the range of the days left let me just check that let's go DF days left describe yeah so max is 49 okay so we don't have that much of a Time Horizon here but yeah you can see uh a very unimportant feature is seems to be the airline the airline doesn't make a huge difference as it seems um yeah so you can look at these feature importances interpret them you can uh plot them and so on actually let's go ahead and plot them let's go ahead and say uh PLT figure we're going to say figure size is equal to 106 to keep it not too huge here and we're going to do a bar plot we're going to say x0 for X in sorted importances but only the first five so the top five these are going to be the X values and then X1 for X in sorted importances up until five is going to be the Y values um like this there you go so we have a nice visualization we can also change this of course to 10 if we want to see more features but probably then we should use a different figure size there you go so yeah um this is how you can visualize that now let's go to the final step which is the hyperparameter tuning for those of you who don't know what hyperparameter tuning is it's basically fine-tuning the I mean this is now redundant fine-tuning the hyperparameters meaning that when we train a random Forest regressor we have certain variables that we can adjust certain parameters that we can adjust so if I say random Forest regressor SK learn and I go to the documentation you can see that I have the number of estimators I have the Criterion I have the max depth I have the Min sample split and so on and these are all parameters that I can adjust to get maybe a better worse result uh and I also should be able to see no it doesn't show me some code samples here um but yeah this is what we can adjust we can try different configurations but instead of doing this manually instead of going up here now and constantly trying to go with a different uh with a different set of hyperparameters by saying okay Min sample split is equal to something and then uh number of estimators is equal to something and so on I can do it in an automated way I can use uh grid search or random minized search using cross validation so this is what we're going to do uh for this video here so what I'm going to do is I'm going to say from SK learn. model selection import grid search CV and the idea of grid search is that you provide different values that you want to try for the different hyper parameters and of course if you have different features and different values you have different combinations so if I have uh let me just give you a basic example if I have parameter uh one and I have the values a b c and then I have parameter two and I have the values XYZ then of course I have not just three combinations to try I have all these combinations to try so I have to try ax I have to try a y a z then BX b y bz and so on so basically I have to multiply all these combinations um and this is done automatically using a parameter grid so what I can do is I can say param grit is going to be equal to a dictionary and I'm mapping the feature names to collections or to lists of values that I want to try so I'm going to go and say n estimators which is one of the hyper parameters and estimators is going to be equal or it's going to be mapped to 100 200 300 for example then I can do something like the max depth of the tree um is going to going to be equal to either none so no limitation uh or to 10 20 30 and then I can go with Min samples split and then I'm going to go and say 2510 and then I can say Min samples leave and then again I can say one two 4 and finally let's go with the Max features and you can decide which ones you want to use probably it's good to include the default value and some values around it if possible and then you can test the edges so if I do this grid search and I see that 300 is the best number for N estimators I might suspect that 500 might even be better so I can maybe try that again um but for the Max features we're going to go Auto and sqrt now this would be a parameter grid for our grid search and what I can do now is I can ask here to show you the feature again I can ask actually I need to mark all this I can ask how do I now do a grid search so I can say ask pieces about SE selection how to do a grid search now and then I should get a uh give me the code there you go so I can just copy this now can replace this I have the same parameters and basically just did what I wanted to do anyways it did a git search CV using the estimator in our case this is going to be the regression model uh maybe we should create a new one so let's go and say w equals random forest progressor and jobs equals -1 and then we have a cross validation which is fivefold uh then we fit our um grid search on it and we get the best parameters now we're not going to run this because this is going to take forever you can calculate how many combinations you have here you basically just have to multiply all these so you can say 3 * 4 * 3 * 3 * 2 so we have 216 combinations and one already takes quite some time so we're not going to run this if you have however a lot of time or if if you need to do this or if you uh are training on data or using a model that doesn't take too much time you can do that of course but now it would just take forever so what we're going to do instead is we're going to do something else we're going to do a randomized search cross validation which means that instead of going for all these values we're going to provide ranges and we're going to try to get lucky and to just pick values that work so we're going to do way less uh attempts we're going to to do just six fits in this case instead of 216 but we're going to just hope that we end up with some decent values so we're going to say from sklearn model selection import randomized search CV and then also for this we're going to need to install a python package pip 3 install scipi just so we can Generate random values uh we're going to say from scipi stats I'm going to import stats we're going to import rant int and then we're going to say that now we're not going to have a parameter grit but a parameter distribution and here we're going to do the same thing we're going to use the same featur so I can copy this but instead of actually providing concrete values we're going to provide ranges and possible values but we're going to then allow the randomized search to just pick some of them so here instead of providing these three values we're going to say uh Rand in from uh 100 to 300 so anything in between goes as well then for the max depth we're going to provide these values we're going to also provide some more values 4050 it doesn't really matter because providing more values is not going to mean that you do more work because the picking is still random so you're still not going to uh do more of the iterations just because you add some more possible Val vales here um here we're going to do another Rand in from 2 to 11 and here we're going to go with a Rand in from one to five and here we're going to have still these two options and also I think it was it the default was 1.0 not sure about that um that is the distribution and now to actually run this to actually run a randomized search with cross validation again we say Rec equals random forest progressor and jobs is -1 and we say random search is equal to randomized search CV and the estimator is our regression uh tree or regression Forest the parameter distribution is uh equal to parist our dictionary we're going to do two iterations and we're going to do threefold cross validation now f threefold cross validation means we split the data into three folds we train on two evaluate on one and we iterate this so that we basically try all these uh combinations maybe to just briefly explain this I have a video on this already let's say this is all of my data now I can split it into five folds um like this 1 2 3 4 five and what I do is I train my model on all these and I evaluate it on this one then what I do is I train on all these and I eval valuate on this one then what I do is I train on this and these and I evaluate on this one and so on so I do this for all the combinations this is the idea of five-fold cross validation in this case we're going to do three so we only have 3 * 2 fits uh then we're going to do scoring is going to be equal to negative mean squared error and we're going to save both equals two because we want to see the progress and we're going to provide a random state of 10 so that this is consistent and I'm going to say n jobs equals uh -1 here as well and then we're going to do the actual search random search. fit XT train y train and then we're going to get the best estimator so best regressor is going to be equal to random search best estimator so I can run this now and of course I have a problem what's the problem per perhaps you forgot a comma why is that oh yeah because I forgot a comma there you go so totaling six fits we're going to wait for this to finish and then we can look at the results okay so we're done with the randomized search now we can go ahead and see if our best regressor actually outperforms the one that we previously had so score X test and Y test now this is not always going to be the case especially when you do a randomized search CV but let's see we have 98.64% oh I don't want to use wreck I want to use best regressor and I get 1,80 what did I get before 1,66 so here it actually was lower and then for the other values uh this one is how much is this this is uh 6 million 6.9 million and up here we had uh 7.4 million so this one is better and then we have here 2,728 and two 100 uh 2,641 so it seems to perform a bit better I can also go and copy paste this here to actually print uh to actually plot the results uh yeah doesn't look too bad so in this case it seems to have improved the performance it's not always going to be the case especially not if you just use six fits but if you use a grid search or if you do a more comprehensive randomized search probably you're going to get an improvement most of the time from hyper parameter tuning all right so we successfully went through the machine learning process we completed the project we trained a regressor to predict flight prices and it performs quite well so if you have some data that's similar to this one with the same locations the same Airlines and so on you can just go ahead and use the best regressor to do a predict on the data that you provide the same way that you did it here or we did it here for the uh X test data just provided as a panis data frame and then we can do predictions uh and predict the flight prices and of course if you have a different data set the process is probably going to be quite similar um so yeah this is defa machine learning process now let me get back one more time to Pieces so for those of you interested in pieces again it's a very um powerful integrated environment in integrated co-pilot it helps you across multiple different tools as I said you can use it in jupit lab you can use it in pycharm vs code you can use it on a desktop again I can just open up pieces for developers I can browse my SN I can ask questions I can go and say here for example flat list and I will get my flattening nested list I can uh modify it I can see where exactly I got this from this is also interesting I can not just save the snippet I also know where I saved it from so I can go back and visit the website if I'm interested in that um all in all it's just a very nice integration and also with a co-pilot and the feature that you can also use local llms for more privacy everything stored on your system is a very nice and Powerful tool so if you're interested in it check it out in the description down below 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
Original Description
Today we complete a full machine learning project and we go through the full data science process, to predict flight prices in Python.
Pieces: https://pieces.app/
Dataset: https://www.kaggle.com/datasets/shubhambathwal/flight-price-prediction
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: https://www.neuralnine.com/books/
💻 The Algorithm Bible Book: https://www.neuralnine.com/books/
👕 Programming Merch: https://www.neuralnine.com/shop
💼 Services 💼
💻 Freelancing & Tutoring: https://www.neuralnine.com/services
🌐 Social Media & Contact 🌐
📱 Website: https://www.neuralnine.com/
📷 Instagram: https://www.instagram.com/neuralnine
🐦 Twitter: https://twitter.com/neuralnine
🤵 LinkedIn: https://www.linkedin.com/company/neuralnine/
📁 GitHub: https://github.com/NeuralNine
🎙 Discord: https://discord.gg/JU4xr8U3dm
Timestamps:
(0:00) Intro
(0:26) Data Exploration
(11:30) Preprocessing
(17:48) Training Model
(21:33) Evaluating Model
(32:30) Hyperparameter Tuning
(44:30) Outro
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from NeuralNine · NeuralNine · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Visualizing Stock Data With Candlestick Charts in Python
NeuralNine
Python Beginner Tutorial #1 - Installation and First Program
NeuralNine
Python Beginner Tutorial #2 - Variables and Data Types
NeuralNine
Python Beginner Tutorial #3 - Operators and User Input
NeuralNine
Python Beginner Tutorial #4 - If Statements and Conditions
NeuralNine
Python Beginner Tutorial #5 - Loops
NeuralNine
Python Beginner Tutorial #6 - Sequences and Collections
NeuralNine
Python Beginner Tutorial #7 - Functions
NeuralNine
Python Beginner Tutorial #8 - Exception Handling
NeuralNine
Python Beginner Tutorial #9 - File Operations
NeuralNine
Python Beginner Tutorial #10 - String Functions
NeuralNine
Python Intermediate Tutorial #1 - Classes and Objects
NeuralNine
Python Intermediate Tutorial #2 - Inheritance
NeuralNine
Python Intermediate Tutorial #3 - Multithreading
NeuralNine
Python Intermediate Tutorial #4 - Synchronizing Threads
NeuralNine
Python Intermediate Tutorial #5 - Events and Daemon Threads
NeuralNine
Python Intermediate Tutorial #6 - Queues
NeuralNine
Python Intermediate Tutorial #7 - Sockets and Network Programming
NeuralNine
Python Intermediate Tutorial #8 - Database Programming
NeuralNine
Python Intermediate Tutorial #9 - Recursion
NeuralNine
Python Intermediate Tutorial #10 - XML Processing
NeuralNine
Python Intermediate Tutorial #11 - Logging
NeuralNine
Python Data Science Tutorial #1 - Anaconda and PyCharm Setup
NeuralNine
Python Data Science Tutorial #2 - NumPy Arrays
NeuralNine
Python Data Science Tutorial #3 - Numpy Functions
NeuralNine
Python Data Science Tutorial #4 - Plotting Functions With Matplotlib
NeuralNine
Python Data Science Tutorial #5 - Subplots and Multiple Windows
NeuralNine
Python Data Science Tutorial #6 - Matplotlib Styling
NeuralNine
Python Data Science Tutorial #7 - Bar Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #8 - Pie Charts with Matplotlib
NeuralNine
Python Data Science Tutorial #9 - Plotting Histograms with Matplotlib
NeuralNine
Python Data Science Tutorial #10 - Scatter Plots with Matplotlib
NeuralNine
Python Data Science Tutorial #11 - 3D Plotting with Matplotlib
NeuralNine
Python Data Science Tutorial #12 - Pandas Series
NeuralNine
Python Data Science Tutorial #13 - Pandas Data Frames
NeuralNine
Python Data Science Tutorial #14 - Pandas Statistics
NeuralNine
Python Data Science Tutorial #15 - Pandas Sorting and Functions
NeuralNine
Python Data Science Tutorial #16 - Pandas Merging Data Frames
NeuralNine
Python Data Science Tutorial #17 - Pandas Queries
NeuralNine
Python Machine Learning Tutorial #1 - What is Machine Learning?
NeuralNine
Python Machine Learning Tutorial #2 - Linear Regression
NeuralNine
Python Machine Learning Tutorial #3 - K-Nearest Neighbors Classification
NeuralNine
Python Machine Learning #4 - Support Vector Machines
NeuralNine
Python Machine Learning Tutorial #5 - Decision Trees and Random Forest Classification
NeuralNine
Python Machine Learning Tutorial #6 - K-Means Clustering
NeuralNine
Python Machine Learning Tutorial #7 - Neural Networks
NeuralNine
Python Machine Learning Tutorial #8 - Handwritten Digit Recognition with Tensorflow
NeuralNine
Generating Poetic Texts with Recurrent Neural Networks in Python
NeuralNine
Stock Portfolio Visualization with Matplotlib in Python
NeuralNine
Analyzing Coronavirus with Python (COVID-19)
NeuralNine
Making Text Images Readable Again with Python and OpenCV
NeuralNine
Neural Networks Simply Explained (Theory)
NeuralNine
Motion Filtering with OpenCV in Python
NeuralNine
Top 5 Programming Languages To Learn in 2020
NeuralNine
Simple TCP Chat Room in Python
NeuralNine
Image Classification with Neural Networks in Python
NeuralNine
Edge Detection with OpenCV in Python
NeuralNine
S&P 500 Web Scraping with Python
NeuralNine
Simple Sentiment Text Analysis in Python
NeuralNine
Introduction - Algorithms & Data Structures #1
NeuralNine
More on: ML Maths Basics
View skill →Related Reads
📰
📰
📰
📰
I Don’t Want to Build Another App. I Want to Find Out Where the Models Break.
Medium · Machine Learning
A Graph Neural Network Model for Real-Time Gesture Recognition Based on sEMG Signals
ArXiv cs.AI
Evaluating the Effect of Frame Rate in Sequence-Based Classification of Autism-Related Self-Stimulatory Hand Idiosyncrasies
ArXiv cs.AI
Measure, Don't Estimate: Labeling Speakers Without a Gated Model
Dev.to · Dima Statz
🎓
Tutor Explanation
DeepCamp AI