Data Science Interview Questions | Data Science Tutorial | Data Science Interviews | Edureka Rewind

edureka! · Beginner ·📊 Data Analytics & Business Intelligence ·2y ago

Key Takeaways

Prepares for data science and big data analytics interviews using Python certification course

Full Transcript

hey I all uh to the session on preparing for data science interview questions I'm Karthik so I've been like working in this data science domain for now close to 78 years so in this session we are uh going to focus on certain fundamental questions and the thought processes you need to sit for an data science interview and then from there on we'll make the questions a bit more complex as we move on and will try to answer uh which kind of skill sets people normally look at when you appear for a data science interview in any company so there are like various roles depending on that uh the complexity and the variety in the questions might change uh but this session will try to cover things in a fundamental level so that It prepares in a very common ground irrespective of which role you are applying for you you might be able to at least get a perspective of what data science requires as such right so with that note let's see uh how we going to structure the various questions that's going to come up in this session today majorly focusing on statistics data analytics machine learning and probability so these are the four headers under which the questions will come and I'll discuss the question and how to approach a particular question in structured approach right in a structured Manner and once we understand the problem well we will see how does that thought process of coming out with the solution really works right so all of you you know that uh data science is in booming State many openings are coming up in uh across the globe in various companies irrespective of which company it is which particular business it deals with there is a potential of some applications from data science right they have lot of data different systems of their businesses generating the data with uh an enormous amount of volume velocity and variety so with that sort of data asset that every company has now got they want to now leverage it towards growing the business to the next level so you have some of the stats here like this is more than sufficient motivation that getting into data science would definitely land you in some really good professional career okay so let's start with the questions here directly we'll in the beginning start to focus on some of the fundamental questions which is more for you to understand what is data science than like uh a particular interviewer asking you that question for instance uh many people wonder what data science is all about right though there are many online sources and blogs which describes data science in a very nutshell this is what it boils down to right a person person who is very good in understanding the computer algorithms a person who understands the statistics and mathematical ideas and applying these two knowledges from the Computer Science and Mathematics into a particular application right a business application where somebody sees a value coming out from the data so how do you apply that so that's how kind of data science approaches so when you combine these two powerful Concepts coming in from Computer Science and Mathematics on a real world application the sort of outcome that comes from particular data science project goes in a direction where people see are return on investment right so the people you bring in the technology you bring in the ideas you are working on all of it should kind of gives you some return on the investment you have put in so that's where Industries are started to looking at uh data science so various subjects which are very important for you to know statistics computer science Applied Mathematics and then subject objects like linear algebra calculus and a few more right so fundamentally from computer science algorithms and data structures might might be very useful from the mathematics or statistics and things like calculus linear algebra Matrix factorization and Concepts like that and from the application it is more from your experiences from the industry if you have worked for retail you know how the business process in retail works right so people often also ask from the technology end do we need any sort of experiences in Python language right python or like for example our programming as well uh so python is one of the most uh looked out for kind of programming skills particularly when you want to build Solutions in data science domain and with availability of libraries like numai pandas python has now established its ground very strongly in giving a very robust frame workk for Designing data science Solutions right and in particular things which it has like lck dictionaries TOs and stats are one of its own uh sort of one of its capabilities which sets python in its own League of programming languages suitable for up coming out with data science Solutions so there are many more other libraries as well apart from this for building machine learning algorithms but these are some common uh libraries that you would normally find uh people using it and also with distributions like Anaconda python has shown its capabilities even for a production grade solutioning right wherein you make sure that all the dependencies that one particular library has for building a data science solution is all in one place so quite a popular programming language uh in the recent kind of happenings Although our programming is also equally good uh in terms of producing a quick prototype for most of your modeling tasks but python is moving it itself into a production grade where things can be deployed after the sort of prototype into a production environment and it can phas the customers from day one so that sort of capabilities are coming up with python right so let's talk something a bit more specific with the data right so when people are doing any sort of data analysis they normally face something that we know by the name selection bias right so what is actually a selection bias the fundamental uh place where you start doing a data analysis is by selecting a representative sample right so that's where we like normally start doing any analysis so when you like working for a company which has let's say 1 billion records in their databases like one billion is like very very large number which represents various customer uh customers data or it might also be depending on which feature you are working on and so on so if you collect all of those it might very easily come to 1 billion records which is nothing but in a structured form number of of rows so with that an enormous amount of volume in the data any analysis that you take up might have to have lot of filters like saying I only want to analyze a particular feature in my product let's say right and I want only want my customers from XYZ region which is let's say top four region or top five regions so you might like put many features or filters like this but later on U if you would like to do a kind of an analysis which covers most of your customer base right there comes the tricky situation of not being able to use the entire volume of 1 billion records at the same time you want to do a really good study or analysis based on what data you have so in statistics we normally use this idea of doing a kind of a randomized selection right so with this randomized selection we make sure that out of these 1 billion records we are choosing a small SE set let's say of 1 million which is a true representation of the entire population right but what happens with this is while we do this 1 million record selection in a randomized way there are chances that you might have certain bias in the analysis obviously because you are not using the entire population so selection bias is this particular sort of a characteristics while you are doing a sampling on a large population of data very common example for this is uh if you want to do a exit pole analysis of particular election even before the election results are coming up and you have not chosen a representative sample for doing that exit pole analysis right by that you I mean you only have asked some questions for a selective few from the particular constituency and they have a opinion towards one candidate but that doesn't represent the entire opinion of the population in that constituency so selection buys is like very important to handle and most of the time people employ things like randomized selection or selection sampling techniques like uh stratified sampling and so on so by that you can minimize this selection by is so these are some very generic questions so let's start with some sort of statistical questions and also how to deal with different types of data okay so doing any sort of data with a structured information so structured information I mean there are many rows and like uh many columns and it looks more like a tabular data right so with such a data in in place there are like these two different formats one saying the long and the wide so let me like show you an example here you have a record of two customers right and you store just two values which is the height and the weight so these are like in columns so with the these two customers these height and weight being a separate column is one format like a long format let's say transform this by having only one particular column which will say attribute right by that I will bring in these two columns as one column by calling that as an attribute and put the values in one column so this sort of format is called the long one so what really happens is instead of having two separate columns for two of your attributes you put all both of those into one column and by doing that there are a lot of benefits with respect to the task you have in your hand particularly in data visualization certain data visualizations would need you to not put your attributes as a separate column but rather as the one column which can have the attribute names so which might then go into building your Legends right so these kind of techniques are kind of very common formats between like the long and the wide and very frequently will people like deal with both these data formats depending on what task they are doing particularly when we are building visualization dashboards okay talking a bit more uh on the data analysis perspective uh people like uh know that in stats normal distribution uh kind of is that one like the Godfather of the distributions you have many distributions which normally people try to see if is present in my data or not but the moment people kind of see normal distribution coming up in any data things are kind of bit easy to understand and in typical case any distribution any data distribution that you would like to find out given data for analysis it gives us a lot of characteristics around what the data is about if I'm let's say analyzing the salaries of the employees in my company right I might see that there are some employees who are in that like that thick rust in uh the center where majority of the people are sitting with a moderate level of salary ranges and then there are these sort of extremes on the left and the rights so you are like very commonly people refer whenever you talk about salaries to a bell curve right and then they start talking about top 25% of the performers in my company the bottom 25 and the middle one which are like are sort of the normal performance so this sort of bell curved distribution is very commonly understood and as well as used in doing many data analysis so is the other distributions as well but normal distribution has its own significance so when somebody asks you around uh anything around normal distribution the first thing you should visualize is the symmetrical bell-shaped curve right and the moment you get that bell shaped curved in your imagination start thinking of certain properties like what is the mean of a normal distribution what is the standard deviation of a normal distribution and in particular a special case of normal distribution which we call the standard normal distribution so in that standard normal distribution we know the mean is exactly zero all the time and the standard deviation is exactly one right so there are different places where normal distributions are kind of used and if you are comfortable with ideas like Central limit theorem or the law of large numbers you might want to relate that as well to normal distribution particularly the centrer limit the right but the idea is a distribution which is symmetrical around the mean so that's what a normal distribution is so depending on which variable you are trying to analyze even a given data set whether it could be like an employee salary or your sales in a for a business of yours right or your uh number of uh let's say interactions of the customers on your product so any variable that you define can have a symmetrical bell-shaped distribution which we normally refer by normal distribution and the moment we understand that something follows a normal distribution all these properties of that distribution is like revealed so that's sort of the importance of doing any analysis around the distribution of data and normal distribution like very common one and in many statistical techniques in even model building exercises if you have anything in a normal distribution U many any other possibilities of applying certain modeling techniques comes out evidently there and also there are many other modeling techniques in stats and machine learning where there is an fundamental assumption that thing should follow a normal distribution if it is not following then the model is wrong so there are many use cases of knowing what normal distribution is but in simple terms it's a symmetrical bell-shaped curve right AB testing so quite a popular approach people particularly who are working with product right and what happens is U when you are as a company having lot many features inside a product for instance if LinkedIn is a company which has a web page right it has lot of features inside that you have some jobs of portal in LinkedIn you have places where you can connect to your professionals uh in the similar industry you can also read about uh the post people are doing in the portal and so on so there are different places in the website with many features so what happens is if LinkedIn as a company is looking looking for some changes for instance changing the entire website's design in Aesthetics design and Aesthetics or changing one particular feature inside their website right so these changes are normally accompanied by sort of a process called AB testing so what happens as an analyst you might be working with LinkedIn and say on a fine day they might come out with a new feature new design or new sort of changes in their website so you as a person would tell okay this is my framework for testing this new change by defining a metric so my metric would be in simple terms saying if I change this website from A to B is my number of footprints on the website going to go down or not so this is my metric and if I successfully establish the fact that after rolling out this new website my number of customers who are going to visit my website is not going to go down I can be confident that okay fine this works now roll out this new feature so in this framework we normally have two set of users to identify the particular uh risk associated with uh getting this new feature into the platform and in which we in a randomized way put one user group and expose them to an older website and another user group and expose them to the newer new features right or the new website and when we compare the results of a particular metric like the number of clicks or the number of purchases and so on we should be able to see that these two groups uh are either EX exactly the same or quite different and if it is on the negative side of the difference we say the feature is not good and even if when the difference is not at all there we say even if we bring this new fature nothing is going to happen so this AB testing framework is quite robust in its own um way right and a very common question if you have like worked as dat analyst or if you are expecting to be like sitting for this data analyst kind of a role knowing AB testing framework is very important okay so sometimes also when you do these kind of AB testing sort of analysis uh people normally come out with sort of saying uh what should be the sample size of my uh users whom I should be getting to participate in my AB testing framework or also when you are building some models you might uh see that there are certain statistical measures so which has to be evaluated by the end of model building exercise like if you're building a machine learning model let's say and you want to see if the those metrics on which I'm evaluating are really good or not right so in that sensitivity is one of those methods or like metrics which we normally evaluate and I'm going to show you some uh something that we normally refer by the name confusion Matrix so I'll spend some time explaining this and then come to what we mean by like sensitivity so let's say you are building a model right a model for predicting whether whether a particular customer is going to purchase from my platform within one month or not right so very simple problem statement which might include many variables that we would bring in and then finally build this model saying okay this is my final model which says with 90% accuracy whether my customer is going to buy from my platform let's say an online e-commerce platform within next month or not so this is my model so now as without going into the details of the model let's assume that after you build the model you have got the results so while we analyze and evaluate what the result is all about we might come out with a confusion Matrix so what it says so obviously when you are building a model which follows a supervised way of learning you will see from the historical data after people have purchased in the platform within next one month whether they are buying or not so I can obviously create u a really good training data set right which will contain the information after people let's do the first transaction with me in next one month whether they are buying the next product or not so with that data set I train my model and uh the way confusion Matrix puts that is by saying my actual data says something and you have predicted something right so let's kind of get into the details of that so this particular box which says my actual data says the customer will buy and you are also predicting the same so this we call the true positive the prediction is actually true right in a positive direction saying uh the purchase happened now like move diagonally opposite to this TP which is this TN which is true negative which means the prediction of uh your model saying the customer will not buy is actually matching with the actual data as well right so both of these values the true positive and the true negatives for the two cases is the right predictions from your model but consider the off diagonal elements the false negative and the false positive and these two cases this is sort of an error why because your actual data says the customer is not going to buy in this case let's say but your prediction says he's going to buy so the prediction is actually positive whereas the actual data is on the negative side so this is a false prediction right so you have your uh in this case your FP which is uh the false positive cases and on the off diagonal element if you look at this one which is FN which is your false negative for the cases where you are predicting the customer is not going to buy but in the actual data it says that customer actually has brought the product so in in this case the model is wrong so the type one and type two errors needs to be taken care of when you are building any machine learning model if these errors are low then your model is going to move towards that 100% accuracy Mark but normally any machine learning model has its own limitations so particularly there is one metric which we refer by calling sensitivity so so what happens is these true positives and true negatives needs to be controlled right if my model is very good in true positive ones like the positive cases of when the customer is buying but it is doing very bad job when the customer is not buying the cases in which the customer is not buying then the model has some sort of issues right it is doing only good in one place but doing very bad on the other case so I need to find out that by somewh Trick so sensitivity help us to find that out which is in simple terms is a ratio between the true positive in the denominator we have all the cases of positive predictions so imagine now if the type 1 error is going to grow my sensitivity is going to come down so if my true positives are like very high the sensitivity will also be high so this is sort of what we call uh the statistical power if this sensitivity is really good uh I would say that my positive cases are predicted well and the exact opposite of this sensitivity is what we know by specificity uh so we need to make sure that in a very good machine leing model sensitivity and specificity both are balanced right so in very simple terms this is what be like mean here the ratio of true positive by the total positive events there and as I mentioned both of these uh sensitivity and specificity play an good role when you want to evaluate a model's output right and one more common problem so these questions might be immediately following one another when people ask you about sensitivity and specificity as you know it's about the machine learning model's output right when the model is done you understand whether the model is good or not so in those cases we also come across some uh kind of issues like overfitting and underfitting given machine learning model right so these words are very common and the idea is depending on the complexity of your model you might see that you want to adapt very sort of exactly to your data points or you might want to do a generalization so for instance here if I have these red and blue dots here right and if I draw a curve like this which separates the red from the blue and when this separation happens I'm building actually a classifier using some sort of modeling technique but now Imagine by drawing a smooth curve like the one which is given in Black you might be overgeneralizing it right by which I mean there might be some red dots on the other side of this boundary you can obviously see that but the moment I'm kind of a bit more flexible by drawing this Green Boundary which actually covers all that issues which is coming out with these red dots on the other side of the boundary so this Green Boundary has like taken care of that but the problem when we are building any model right the idea is you need to generalize to the pattern found in the data so if you don't do that generaliz ation well you are underfitting but if you do that generalization like too specific you are overfitting so this curve might be represented by some polinomial right but that zigzag kind of a polinomial might be bit more complex than a smooth curve like the one which is shown in the black so you need to be very careful when you are building a model particularly in the cases of regression models where it is represented by a line and a polinomial you need to make sure that the polinomial is not so complex at the same time not so simple then you will either end up in an overfitting situation versus an underfitting situation so we need to have a good balance between these two right so in summary when kind of statistical questions comes in it would mostly covering things like uh some basic statistical properties as you would be like very aware of like things like standard deviation averages how to interpret median how to interpret quartiles right the first quartile second quartile and so and so on and how what do you mean by percentiles right these are some basic questions a bit more complex in nature might be discussions around sensitivity overfitting underfitting these are like statistical ideas so you want to prepare maybe from a Basics level using the properties like standard deviation mean and so on till things like overfitting uh underfitting statistical the sensitivity and specificity kind of ideas so that will like make you ground a bit more stronger when you are going for the interviews and these are at least the bare minimum for you to understand in the statistical Concepts right if anything less than that you might like face some difficulties in the interview okay but let's also talk about now uh questions which are related a bit more on data analysis so let's see how what kind of data analysis questions which might pop up in the interview okay so some gener questions like this people normally do analysis on structured data which is in rows and columns but there might be cases when the data is not so well structured and those places the data might be textual for for instance uh in Twitter right if you're doing any sort of algorithms like sentiment analysis quite commonly known algorithms so in that case the sentiment analysis could be for a brand for a election campaign or maybe something else around your product features and so on uh so text analytics in its own are really large domain and in python as well as R there are number of libraries so in particular R has libraries like TM right the text mining package python as well we have packages like pandas packages like the numai ones right and also packages like nltk which is built only for natural language processing so it can deal with many different sort of text mining approaches or text analytics approaches so in comparison if you talk about as I said the robust in Python is much more than in R but in terms of features both are powerful enough with the libraries and uh packages that it offers right one of the fundamental sort of starting place when you do any analysis so when you are given a data set and you are asked to do some sort of basic analysis of what that data tells you maybe typically of questions like I am in a retail business and my sales in a particular region is going down so this is an analysis that is expected out of you and you need to through in understanding what really is the problem in the sales going down so if this is sort of the data this which is given to you you might want to First Look at the transactional data which is present in the system then you might also want to go to outside of your network maybe you might get the uh Sentiments of your customers from social media platforms and so on so there will be different sources of data that you will collect but often times uh collecting the data is not only the task right and not like only building a model or doing statistical analysis might like come very later in the stage but what comes before that after you have collected the data is to make sure that the Integrity of the data is maintained you get rid of all the unwanted noise from the data and then finally repair the data for doing the sort of modeling exercise or doing descriptive analytics on top of it so this cleaning and understanding the data doing lot of Explorations with plot in essence takes close to 70 to 80% of your time in any data analysis task so if your company maintains the data in a very well structured way uh this kind of heavy time which we spend on data analysis might be red the data cleaning might be reduced otherwise you need to like take this up for any new project that you take take up which for which the data is not available in in a prior or you don't have uh like any pipeline which do these this cleaning you have to write it down of your own so very very important if you don't do the cleaning part and understanding the data well the analysis or the models that you build might end up giving you a very very bad uh performance right so very important as I said 80% of the time people normally spend on this uh task right and often times uh when you are analyzing things like the example I told my sales are going down what do I do it is not possible to come out with such answers to complex problems like this with just one variable right so you might also want sometimes to move Beyond one variable and talk about let's say how to do multivariate or bivariate kind of analysis so often times this question comes up uh where you like ask to distinguish between this univariate bivariate and multivariate Analysis and the idea is very simple in any sort of analysis uh it is not only one variable which kind of decides uh the end output of your analysis but there are multiple factors involved so when there are multiple factors involved you might also want to look at things like correlation there are multiple variables you want to see if there is any correlation between these things sales are going down but because of what is it because my sales representatives are not going to the market or is it my products are bad or is there some other reasons so with all the variables in one place you might want to go and dig deeper to see if there is any relationships coming in the variables or not and when we collectively get all these variables together and do some sort of coherent analysis around the problem you come out with a really crisp answers to what you are trying to analyze right and moving on there is also times when people uh do some sort of grouping right with the data you do a sampling right you get a data set in your system or in in whichever servers you're doing the analysis but in that there might be lot many number of times when uh even the randomized sampling of getting the true representative from the population like that might not not work well right so in those cases you might want to do some sort of systematic sampling or maybe a cluster based sampling as well wherein you might decide to say I want to analyze the issue with only five regions in my mind and with the five regions I'm going to form different clusters or in the systematic sampling you might also want to say uh that with the five regions that I have got I might want to analyze only for one product right which is not doing that good in the sales so these kind of sampling techniques like the cluster based one or the systematic sampling techniques and there are different names for this people might be able to give a very good uh interpretation of what really went wrong in whichever sort of analysis you're doing so one example is like sales going down but you can adapt this to other analysis as well but the idea is instead of doing a randomized sampling by which we are not very sure which kind of data is coming in uh the the data set which we want to use for analysis is but if you do it in a cluster basis a cluster or a systematic sampling you know exactly which clusters or which sort of uh regions in in this example you are like analyzing and in your end of the analysis you'll be very able to say uh this is not like a randomized sample that I have taken but from these five regions so there are many different ways of uh doing clustering uh cluster or or sort of the systematic sampling which kind of helps in this particular final end result of your anal to put your end results in the right perspectives right instead of doing a randomized sampling okay one more quite a useful sort of an idea kind of widely borrowed from the field of linear algebra and this is a bit related to what we earlier saw between moving from one variable to multiple variables right and Egan value and Egan vectors kind of a concept borrowed from linear algebra helps us to bring in some in some way a linear combination of different variables together for instance in some complex analysis it might happen so that given data set it might have many columns right let's assume you have a data set with 1 million rows and uh let's assume 10,000 columns so and these 10,000 columns are some features there are complex problems like that but in most often like most of the time not all the 10,000 variables are useful right the input variables so what we can do is we might want to transform this data set in a lower dimensional Space by which we mean this 10,000 columns can be reduced to let's say only 100 columns right so Egan value and Egan vectors are these ideas which helps us in this transformation and the idea is can this 100 variables be represented as some sort of linear combinations of the 10,000 variables and if I'm able to do that my dimensionality is reduced the time I take to do the analysis is kind of also reduced and uh the representability which will come with only 100 variables will go up right so quite a powerful idea Egan values and the Egan vectors and as I said the Egan vectors is kind of that linear combinations of many uh uh kind of variables there and uh this calculations around Egan vectors normally happens for a correlation or a co-variance kind of a matrix which as you know the measure correlation is also about uh how two two variables are related or how strongly two variables are correlated right so that's why we are also saying uh this Egan vectors can help us to compress the sort of data that we have right and that's because of one Egan Vector can be representing a 100 column 100 variables together right so that's sort of how it works quite a powerful idea and commonly used methods for reducing the dimensions of an large data set like the PCA principal component analysis is actually based On LAN value and igen vectors so if somebody asks you about igen value and igen vectors in an interview also talk about the PCA principal component analysis which is actually based on these two concepts so that gives them a good idea to the interview view leg you know about Egan values and Egan vectors and you are also able to think of its application like in PCA right so we talked about this false positive and the false negative cases in our confusion Matrix example so this is exactly the same we also talked about the type one and type two error okay so but let's now also drill further and say examples or kind of scenarios when the false positives are important and scenarios where the false negatives are sort of important and the by the term importance we mean are we like allowed to do this mistake if we are building a machine learning model are we even allowed to do a mistake on either of the cases dep positive or the negatives so for instance here if I take an example in a medical uh domain where we have let's say a process called chemotherapy which is normally given to cancer patients which is a radioactive kind of a therapy which kills the cancerous cells right so it is very focused sort of a therapy on the cancerous cells so what will happen if you like predict let's say you building a model for detecting cancers right given a CT image and this model would obviously not be 100% correct all machine learning model has its limitations but you are here required to predict this whether a patient has cancer or not and based on that radiologist might decide that whether the chemotherapy is right for this patient or not but imagine now if if you have predicted somebody to be positive for cancer but the patient is actually not having the cancer cells there right so in those cases you might end up saying let's go ahead with the chemotherapy but the side effects of chemotherapy are like very very adverse right because you're giving these therapies on the healthy cells if the patient is not having the cancers so in these cases sort of the false positives becomes a bit more important so it it will be absolutely fine if your model says the patient doesn't have cancer if even if there is like this slight possibility of cancer present in the cells of the patients but in that case you are not like exposing the patient with a chemotherapy there right which is like more harmful than saying that the patient doesn't have the cancer right so in these cases the false negative though the false negative itself is not so good in this case but at least with this particular example the false positive gets the importance than the false negative but both are bad as you know know right from the confusion Matrix discussions so in simple terms it is better to not expose the patient with a false positive with a treatment like this chemotherapy like treatment then it is like much better than saying you don't have cancer okay and a very similar example uh in some other context might also come up so if you would like to think of some other examples in the same context okay so where is the other case now which is the false negative right so we talked about the false positives importance but uh there might be also cases where false negative might become a bit more important there and for examples like this if you are let's say building a model where you want to convict a particular criminal basis all the records and the arguments which has happened in the code right and let's see what would happen if you make a criminal Go free right because your model says it's false negative the though the person is actually a criminal but because your model predicted based on all the evidences you had the the person is not a criminal so you're letting a criminal like walk free in society so that kind of is more harmful than convicting that person and maybe for a prolonged period you might also want to get more evidences and build a stronger case so it is fine to keep a suspect in behind the uh bars for a longer period Then letting the suspect Go free there when we like know that that it might be a case of a criminal going free from the Judicial Systems there right so in these cases the other case becomes more important so keep in mind it is very easy to get yourself confused between this false negative and false positive but if you keep an example in mind always and like don't give any room for confusion there though it is a confusion Matrix based on which these two ideas comes in you will be able at every time put these examples in front and talk from that so if you start to explain what false negative is in terms of the formula you might get confused but if you take an example and then explain things are much more clear for you as well as the person who is hearing that in the interview right and in cases when both are important typically the one which uh relates to banking industry you are building a model which will decide whether to give a loan to a person or not Bas is many of the input attributes that around which you have like collected the application from the customer but here you say if the customer is really good and you are missing the opportunity there of not giving the loan versus the customer is really bad in terms of its his or her credit history and you are giving the loan in both the cases in one case you're losing the business in the other cases you're taking a risk in which you will lose your money right so in this case and in this example both kind of has an equal role so if your positive or false negatives are in either of this is high you you will end up losing some chunk of your money there keep these three examples in mind and every time you get to like hear false positive false negatives things should not be like confusing at all okay so now let's also talk about building a machine learning model so so far we have discussed about what happens after building the model right but let's step one uh uh like get one step back and see how do we normally build uh a machine learning model and what kind of processes we normally follow so when we are like building a machine learning model we know that we need to given a data set we need to divide it into different buckets or different parts so the commonly known uh divisions that we like have is your training data right then we also divide the data into something called test data and sometimes people also divide uh or keep one portion of your large data set which is called the validation data so often times people confuse between the test data and the validation data right so what happens is in the training process there are certain models wherein while you are training you will use the training data obviously but in the process of training you can also involve something like a validation step right which will make sure that during the process there is one part dedicatedly given for the validation of the model and when the model is done you might see that the final model is well trained on the data at the same time validated but when the model is completely done then only you get into a process that we call testing right so you can imagine like this you have a data of thousand uh Records you keep some 700 records for training 100 record for uh validation and the remaining 200 records for testing so there are three splits right if I would like to explain this with an example this is how it will happen so there is a process called kfold cross validation in which K can be any number like between five and 10 mostly there are like standards saying fivefold cross validation or 10-fold cross validation and the idea is when you are building your model you will work with a training set right and a validation set in which a small portion of the data you keep for validation and the rest you use for training so what you see here test set can be like replaced with a validation set right and you can see that this is a rolling uh sort of subset and you keep changing it in each fold so you go for the first fold of the iteration you keep one validation set and the rest of it is the training set and the next fold you move this window to another subset and the rest is training data and so on and when this model is done using this kold cross validation approach in the end you will get a model which you can then use on the testing data to see if the accuracies are good or not so this kind of brings in a lot of performance improvements people have also found validation said to be an really good uh way of tuning the parameters in many machine learning models as you might know there are something called parameters typically in the neural network models and these parameters need to be tuned as the model is kind of proceeding so we cannot use the testing data set for tuning this parameters so validation set kind of comes very handy in those cases right so we just talked about the cross validation so when you keep moving this validation set in each of the fold first fold second fold third fold and the validation set is keep changing you kind of do this process of cross validation right and the idea behind uh doing cross validation is uh is to see how well is your final model generalizes to the data that you have so independent of which data you use for training your model should generalize uh because often times it happens when you train your machine learning model it works very good in the training part but when it comes to the testing the model does very bad the same problem with the overfitting and the uh underfitting cases so in this approach of cross validation you have made sure that your TR model has trained on various subsets of the data right and in the process we also have this small validation set so that every stage of the Cross validation process you're able to use a different subset so that means you have trained your model very well so irrespective of which data you use your model is going to do well in the testing cases so that's how cross validation brings in uh the capabilities okay so with the two pillars like the statistical analysis and the basic uh data analysis I hope you are getting some sense of how people ask uh a particular question coming from either the model building perspective or from normal data analysis perspective right so we're going to know now go a bit more deeper into questions which might relate directly to machine learning so these are all the most questions that you have seen so far are either saying how do we do analysis after the model is built or how do we normally perform simple data analysis like AB testing Frameworks and so on but what if you are asked something very particularly from a machine learning domain right so the next set of questions will cover those part like people might also start with the basics like what do you mean by Machine learning so the idea I think must be very clear you are given a set of data points particular to a given uh domain right and you would like to build a learning algorithm which will take the historical data and predict something for the future so as we talked about in many examples finding whether a convict is actually convict or not like predicting if given the evidences if person is is a convict there or not or predicting whether we should be giving Al loone to a customer or not right predicting the onset of cancer in a given patient by using the given patients historical records and so on and now this algorithms are now even becoming more complex like it is starting to work on speech data phas data which are mostly used for biometric authentication systems right so many use cases coming up from various Industries right so in machine learning the most uh commonly used two types of learning the supervised and the unsupervised learning there are like two other types as well the semi-supervised and the reinforcement learning and the idea is around if you are given a set of input attributes do you have a label which can help to learn the input attributes around any data points that you have or you don't have right so if you have then the approach could be a supervised learning approach versus if you don't have then the approach is more an unsupervised so some examples of the algorithms are like support Vector machine regression a Bas decision trees all of these are the supervised learning algorithms so in a very simple terms if I say you are given an input attributes for identifying let's assume a sort of given an image of different fruits based on the characteristics of the fruit can you like identify whether it is Apples banana Bas or the oranges so if I'm given that label with me the model will run keeping in mind that given these characteristics this is an apple this is an orange and this is a banana but in the other case if you go for a clustering approach where such a label of saying that it is a apple banana and orange is not available then we might just simply segregate the data points with the input features maybe with color with texture or with uh the shape right with that we can maybe say that particular fruit with this shape is like uh you know into a bucket which we can like call Banana or another kind of a spherical shape it might be apple or an orange so depending on the presence of a label uh we can say either to use supervised or an unsupervised learning and both of these approaches are quite common and sometimes there are certain algorithms which can have the both ways it can also learn in unsupervised Manner and the supervised manner so depending on how you model the problem the fundamental difference comes from from the fact on whether we have the label or not okay so when we talk about the supervised learning algorithms other name for superv kind of one of the types in the supervised learning algorithms is classification right and the classification is around given a set of input attributes and the label is like categories right for instance if it is fruit bananas apple and oranges like if it is a customer whom we want to predict into either kind of a defaulter type or a good customer so the classes are two like one which is saying the customer is a is going to be a defaulter the other says the customer is going to be a good customer same is true for when you want to build an classification algorithm for detecting cancer whether the patient has a cancer or not has a cancer right or if you want to detect let's say a malicious content or a malicious file which might be a virus trozen or uh WM or something else right so in that case the classes are now many so more than then one class can also be there but the fundamental idea is We are following a supervised learning algorithm but the type of problem we are solving is a classification problem so instead of saying classification algorithm we can also say it's a classification problem using supervised learning algorithm so these are the various types of classification algorithms like the linear regression decision tree then you have the support Vector machines and so on right so now let's talk about one of the types of classification algorithm called the logistic regression right so very commonly used algorithms and Banks or companies as big as like American Express sort of have leveraged the logistic regression algorithms to quite a extent and they have like built a really really robust implementations of these algorithms particularly in banking sector cases like predicting whether a customer is going to be a defaulter or not given if I issue the customer a credit card or give a loan right these kind kind of decisions can very robustly be taken from a logistic regression algorithm and these algorithms are best suited for two class problems or a binary problem right where you have either yes or no quite a common technique as I mentioned uh and in all the possible cases wherever you have these binary classes of problems you might use a logistic regression a political leader winning a election or not somebody getting a success in an examination or not and as I mentioned uh whether to give a loan to a customer basis whether he or she or is going become a defaulter or not and many of these like binary types so keep in mind logic regression works best for classification problems with two class so one of another widely used uh algorithms like the recommender systems and U like I think this particular algorithm doesn't need introduction so this is that common nowadays uh take an example in Amazon you have a product which you are browsing the products which comes in bottom of the widget which says you may also like or customers who brought this also brought this right so these sort of recommendations is actually from recommender system which is running in the back end if you like take YouTube example if you watch one video the next videoos like starts to come one after the other right that again is a recommender system working in in behind the scene or if you take Netflix if you watch a particular movie it starts to adapt right to a movie which you might like Netflix also uses recommender systems the applications are like coming more and more as sophisticated systems are building in right Facebook uses it for uh recommending friends right you have a set of friends and based on your data coming from the contact mail list Facebook starts to curate friend suggestions right and all of these are algorithms which might benefit the business in some way or the other for Amazon it is if you give a recommendation below a page people might buy more than one product in a transaction for Facebook they will grow their network of people right their connection between the uh uh users are going to go stronger and hence obviously the kind of ads that goo is Facebook wants to sell will also starts to grow right and more the users more the connections more is the sort of interactions you know about the connections as well as the behaviors that people show in a social network so the fundamental idea behind all these recommender systems is to get a meaningful comparison between two users or between two items right for Amazon between any two product what's the similarity if the similarity is really high recommend that product to the for a given uh product in in consideration or if you find that two users are very similar in let's say Facebook you might want to show to each other that you have another friend whom you might want to connect right so there are like many such uh use cases which comes out the moment you get into the deeper understanding of recommender system but the fundamental idea is how do I compare two items the items might be product people movies and so on and how do we compare two users in simple terms so this is what a recommendation system works on so there are quite famous examples like the collaborative filtering approaches user based collaborative filtering algorithms or the item based collaborative filtering algorithms both of the algorithms are quite commonly used in recommender systems and nowadays people have also moved on to Lattin Factor based models like the SVD singular value decompositions and many others so we talked about classification problem and then we said logistic regression is a binary class problem right so you might also be asked something around linear regressions so what if I don't want to have a class of a particular uh uh user or a patient or something like that right but instead if I would ask you can you give me a crisp value instead of a class right so when I'm like classifying a given file into to good bad in which bad can be virus warms frens these are the classes but if I don't want class but rather for example if I want to know the exact value of a house in a particular locality in my city how do I calculate that right so linear regression models in machine learning is one such technique which can regress over a given input data which might include the properties of the houses like number of bedrooms the area in square feet and so on and finally predict a value a crisp value which will be exactly in terms of let's say dollar or in any other currency the value of the price and the idea is once again that you have a training data with you which has labels so from the past data I know that given these attributes of the house what should be the ideal price of a house I'll use that as my training data and then build my model for future so now with any such similar pattern in any data which is going to be coming in future for maybe a new property which is built in some XYZ location I can use the model and predict exactly because these features are somewhere similar in that locality the prices might be in a particular range so a model like linear regression will learn those patterns in the given input attributes and try to predict the price of the house right and the idea is uh if I have a set of data points I want to build a very generic model like drawing this line which is as close as to all the points right so you can like draw infinitely many number of points if you are given a set of data points like this this in a two- dimensional space but the one which is the shortest or the closest to the points is the best line so the red line which you see here is like far away from all these points right so this is not a best line but if I see this blue line which is very close to all the data points is like one of the best lines which I can get from this points right so the idea here is to fit a line passing through as closely as possible to all the data points that I have and minimize the so-called the error which is nothing but the sum of all the the distances right so there are simple linear regression ideas and the fundamental idea that we are following here is your variables are having a linear relationship which means uh with with the increase of one variable the other also increases but if you have a pattern which is not so linear in uh shape like if you like not able to draw a generic line but the representation or the sort of points are aligned in a way that you can only create a model which is polinomial so in that linear regression will not be so useful because the relationship is not linear anymore right so in that case you might want to go for some other regression approach maybe like a polinomial regression which has a nonlinear relationship between the independent attributes so quite a common approach and it has like a really large chunk of its explanation coming from the statistical ideas statistical ideas like hypothesis testing P values confidence intervals and so on so if somebody is asking you around linear regression better would be to start with saying how you build a linear regression model right and then you might give some examples of it so at best if you're not comfortable with these ideas like P value or hypothesis testings you might want to refresh that before you like go for any interview because if linear regression comes up these Concepts needs to be a bit more explained right so when I talked about the recommendation algorithm I mentioned something about collaborative filters right the user based collaborative filtering or the item based collaborative filtering so these are the two commonly used sort of recommendation algorithms right normally refer to as item base so ibcf and the ubcf and the idea as I mentioned is to compare to users or to compare to movies or let's say items in particular so the item can be anything a product a movie or a person and the sort of way it builds the model is given lot of users and their particular let's say in this example they're rating to a movie we now need to find out can we recommend for some users based on the behaviors of other users or their ratings to the movie some suitable movies or not so for example here for Carol Carol has not seen the movie 21 right so there is a question mark there so can I predict this value if it comes to be let's say like close to two I won't recommend the movie but if it comes to let's say somewhere three four or five yep the model says yes recom this movie to Carol okay so one more fundamental problems on when you build the models so as I mentioned in the earlier uh discussions that when we are doing some analysis with the data after you collect the data there requires a lot of cleaning right and exploration as well so in that process of cleaning and exploring the data sets you might often find there are some extreme points so for instance if I'm building a regression model for predicting the house prices and there is this one house with somebody has uh sort of able to sell for a very high price by means of maybe some auction or some other uh sort of marketing gimmick there the point might mislead the model to predict or get itself towards that outlier point right so we don't want to like move towards an outlier point but we need to deal it separately so if you don't have a better explanation for why that outlier is in terms of an input attribute better is to remove it so for instance if I'm like analyzing any data in e-commerce world where I'm going through all the products and the sales that the product has seen in last one week and on the last one week there was a particular day when a kind of a sales day was there like nowadays e-commerce companies do this a lot but in those sales days you would obviously expect that the product's purchase is going to go very high right but does that mean that it's an outlier to me not because if I'm able to explain an outlier by saying that this was a discount day I might be able to handle it separately either I can like simply take all those points which are for the discounts day or sales day and keep it separately or if I would like to have the variable like saying whether the given day is a sales day and keep the outlier as well then the analysis goes under different direction so it's important you handle the outlier before you start to build your model or do any analysis otherwise your insights or your models output might totally give you a different uh Direction and there are very different ways to handle the outliers so some people use approaches like removing any data points which is like outside of the range of uh mean plus three standard deviation right or sometimes people also use the percentile way of doing it any point which is greater than the 99th percentile can be like removed so these are like uh you are removing the toppers from the data points of yours of let's say a SAT examination or a cat examination so the outliers are sometimes can cause certain issues in explaining the model so you can obviously imagine this in very intuitive terms also if you have a set of scores for candidates who appeared for an examination and there was one outlier candidate who scored really really high so do you have a way of explaining that outlier you might be simply calling that person a talented person but does that like explain the model may be difficult right so better is to keep those exceptional cases separate and do the analysis with the rest of it so which gives you the good pattern or good insight from a data so that's how you like normally handle an outlier right and this quite often uh is an important question to answer that if you are given an analytics project with lot of data how do you normally approach it right in typical cases uh the first step is to really go deep dive into the problem in hand and the problem needs to be defined very crisply so no never Define a problem which is Broad in sense so for example if you're building a model for customer segmentation using a clustering approach so instead of saying build a customer segmentation model for all the categories of products that can be like a broad problem but if I say build a customer segmentation model only for fashion category of products right then the problem becomes crisp so defining a problem statement and its understanding is the foremost task and then comes the the kind of exercise of exploring the data in which you will identify outliers missing values and if you need any Transformations like converting from a log format to a wide format or the vice versa you do all that steps in the second and the third step and once we have found out that the data is very good now after we have removed all the outliers and the missing values and so on you then start to understand uh certain uh relationship like given in input attributes relate in some way or the other right so this is a stage where you start to prepare for any further inside building exercise or like model building exercise and let's say if you build the model in this step the immediate step is to validate it right whether the model is really good or Not by using a testing data right and once let's say all of these is done and you are either coming out with a Insight or a model you would like to see in long term how this model is going to perform so it might happen so because every model is not static your data is growing on daily basis so if you want to build a really robust model on a growing times it should upend the model should update BAS Bas on the new data which is available right so over a period of time you should track and analyze how good the model is performing on a real world data and if the performance is going down then it's time to retrain the model and maybe come out with uh an updated model on the data that you are already given right okay so one more uh task as I was explaining in the cleaning process how do we treat the missing values so there are quite a number of techniques to do that so for instance if you have an attribute let's say age right and you are analyzing this age in various segment of people people who are teenagers people who are uh professionals people who are still in their college and so on right and there is one value missing in one of these categories of people let's say teenagers so if the age is missing because I know I am analyzing a group of people who are teenagers by looking at the average age in the teenage group right I can maybe impute a value so instead of discarding the entire row because I don't have the value of age I might be able to impute it by some simple measures like this calculating the average in that group and putting the value there which will not be completely wrong because I know there is a very strong evidence teenagers would be more or less in the range of let's say 16 to 20 right even if I'm wrong in my average calculation it might not be so high it might be like just plus or minus one or two years so which I'm like fine with if I want to keep my data retained and you you might see that in your many applications sometimes having a kind of discarding a particular row because of missing values might be very costly because the data is limited in uh number so that's why people normally do this at a sort of mean minimum or maximum kind of a value or they also calculate the average and impute the value there so there can be some other pattern-based imputation also possible but I'll just give you an example and in other cases if nothing is possible by putting a value if everything is going to be misleading then better better is to like remove that but that can only be done if you have a surplus of data with you if not then be cautious of removing any values particularly the missing ones okay so this question particularly pertains to a machine learning algorithm called K means right every time you run the algorithm you have to Define what should be the value of K right so there are approaches like elbow curve uh which plots the kind of a plot scatter plot between the x- axis which is the number of clusters versus Y axis which is the WSS or within sum of square which is also known by the name Distortion the idea is when we are building the K means clustering algorithm if we find at one point if you like keep increasing the value of K and one point we find that the Distortion is low which means the distance between the data points within a cluster is as close as possible and the distances between two cluster points like a point in cluster one and a point in cluster two is as far as is possible so if that's the case then the Distortion will be like very low but if your points inside a cluster itself is very spread out and your clusters are very close to each other then the Distortion is going to be very high so in those cases the value of K needs to be maybe further increased and at one point using an idea called an elbow curve which will show you a small Kink from where there is a sharp dip in the distorion values and that is an approach appropriate value for K while we are building a k means algorithm so this is how it looks like so you can see here the x-axis is the number of clusters and your y- axis is your within group of sums of square and at one point you can see there's a sharp dip here here and after this point which is like circled in red the value sort of almost saturates so this maybe I can use as the appropriate value of K so value of K can be like six in this case so I hope you are now getting comfortable with uh questions around data analysis statistics and uh even the machine learning part so the next pillar which might very closely be associated with Statistics as well is around probability right so it is like sometimes in most of the standard literature probability and statistics comes together that is not Inseparable any time so in the namebase algorithm like this is one of the machine learning algorithm which is based on the base theorem a probability idea are quite a lot Ed and there are some really Niche probability Concepts like the probability graph models which is uh actually based on the basics coming from Bas theorem and the fundamental properties around probability we'll not go to that detail of probability and interview questions if you have an expertise around probability and probability graph models or nay based kind of algorithms feel like confident to speak about it but most of the time the probability questions are quite Basics and fundamentals like like one the one at least which is asked in interviews depending on obviously in which place you are giving the interview at so let's also like see some sort of approach in attacking a probability uh problems okay so I'll like read it out for you what the problem is here so it says in any 15 minut minute interval there is a 20% probability that you will see a shooting star like a good example rather uh so what is the probability that you you see at least one shooting star in a period of an hour so there is unnown information given to us that every 15 minute interval there is this 20% probability you will see at least one star so we now want to calculate uh this probability in a period of 1 hour right so what is the uh sort of approach we would take here so let build this systematically so we know one fact that probability of Nots seeing the shooting star in Every 15 minute interval is 20% Which like comes down to 0.2 in probability terms 20% chances or 0.2 probability and as you know probability is always between 0o and one so if I would like to calculate what is the probability of not seeing the shooting star in 15 minutes which is like uh the opposite of this right if I take from uh so these are like independent events right so if I take one minus of the probability of seeing one Shooting Star 0.8 will then become uh the probability of not not seeing the shooting star in 15 minutes interval okay what I need to do is then probability of not seeing this shooting star in another 1 hour because these are now independent events like seeing a shooting star in first 15 minute interval the second and third and the fourth in an hours period is independent of each other we can multiply this probability like this so 0.8 into 0.8 into 0.8 into 0.8 which comes down to a value of 0.4 so the probability of not seeing the SHO star in an period of 1 hour is 0.4 right and if we know the value of this probability here all we like have to do to get the value which we are interested in is which is the probability of seeing the shooting star is uh one minus the probability of not seeing it right so the probability here comes down to 0.5 quite a simple approach in terms of how it works right so there might be like similar uh tricky ways of putting the same questions but if you know one approach and having the idea of independent event is right you may be able to get the understanding or like formulation in this way and also keep in mind given a sort of a sample space and many events from the sample space the sum of the probabilities cannot exceed one right so that's why we are able to do this uh if I'm saying uh tossing a coin the probability of tail is going to be 0.5 and the probability of head is going to be the other event which is going to be one minus the probability of tail right so similar is the case with here as well we are like treating this as a binary problem so depending on which problem you're uh going to ATT tackle the approaches are going to be the same but the language and sort of the trickiness in the question might increase right so this is how you can attack that okay so there is this one more question which is around uh generating a random number between 1 to 7 with only a die okay so let's also think about this how we can can like approach this problem so we have like seen random how we Generate random random numbers from a given set of points but this kind of says that we want to do this with a die right by rolling a die we want to find out a random number between 1 to seven so obviously we know that the die has numbers between 1 to six so the probability of getting any one digit in the die is 1 by six like if I do 1 2 3 1 divided by the total number of possibilities that is 1 by six so that will be my probability of choosing any one of the digits there but it is saying it is we want to generate this random number between one to 7 so where do we get the seven so obviously the requirement is that we can like roll the dies twice right then the number of possibilities increases so as as I said there is no way we can get the seventh one right because we have only six digits but if you roll the D twice the number of possibilities of generating this seven random numbers increases so in this case we have now 36 different outcomes possible you can like do the match there which is nothing but uh 6 cross 6 so 1 2 1 3 1 4 1 5 1 16 and for the rest of the digits the same way right 6 cross 6 so that's the different number of outcomes we can get so now for us to get this seven sort of random numbers and imagine that this idea actually relates to uh sampling technique as well when we say we want to get the numbers between 1 to 7 all of those numbers should be equally likely right otherwise it will happen that I might get one and maybe quite a number of times versus uh one particular digit like two only once or so on but if I want to do a very good randomized selection I need to be making sure the probability of picking any one digit between 1 to 7 is equally likely if I'm not doing that I might have a bias right so we have these 36 different outcomes so how do we now make sure that this is like kind of equally likely so first we have to like uh find out a number which is divisible by 7 which is close to 36 so maybe we can exclude one of the possibilities from the 36 combinations we have and keep only these 35 possible outcomes so like excluding maybe 6 comma 6 this possibility if we remove we are left with the remaining 35 possible outcomes so with this uh one reduction in the possible outcome all we are left out with is uh all the possible combinations starting from 1 one till 65 right now if you divide this into seven Parts where each uh like contains five possible outcomes so what will happen is with the seven Parts each having five outcomes whenever any one outcome comes in these seven Parts I'm going to assign a value to it so for instance if I assign the first five because we are going to divide it into seven Parts where each part will contain five possible outcomes so maybe the first five outcomes I will assign to the part one so whenever that five that five outcomes comes up I will say the random number which I have generated is one in the second part I will keep the next five outcomes and whenever that five outcomes comes in Rolling these two dice I will assign that value too and so on so this way what we have done is we have made sure that the random number that we are picking between one and seven are equally likely if you don't do that then there will be a bias so you see here how sort of Statistics is like merged with the probability that this is how the two ideas and subjects travel together okay so one more question on the same line so for instance here if you have a couple and uh let's say they have two childrens so at least one of which is a girl so this is a given scenario so the question asks you what is the probability that they have two girls right it becomes a bit more like tossing two coins problem right where there are different com minations so what you can see here is a couple has two children so at least one of which is a girl so we have a known fact with us so now all we need to do to kind of calculate this probability is to con generate all the possible combinations the first child being boy the second child being girl the first being girl the second being boy and so on right if you write that down this is what the possible combinations are and both all these four are equally likely as you could see so with this case we have like in the question at least one of the children is a girl so that means only three combinations are left out with us the combination where both the children were boys is excluded so in a very simple uh manner you can like just go ahead and calculate the probability of having two girl Childs will be 1 by three so there are total three possibilities which comes in the denominator and you have like the probability to choose uh so there is only one event which favors this probability like saying two girls out of the three that we have so one by three so let's take up this question here which says the jar has th000 coins of which there are like 999 coins which are fair right which means the head and there is one head and one tail and there is one uh coin which is like tampered with and both the sides of that coin is head we need to now pick a a coin at random from this jar and toss it 10 times right so given that we have seen 10 10 hits already in that 10 times of tossing the coin what is the probability that the next toss of the coin is also going to be head we are given a statement here that 10 heads are already seen what is the probability that the 11th toss would be head okay so let's see how we approach this so let's first put these two possibilities in place uh there is this 999 Fair coins and one doubly headed coin Right double headed coin so we need to see the probability of how many times we can get that double-headed coin so if I look at from the jars perspective choosing a Fair coin from this jart is 999 times out of all the Thousand possible coins so which comes to be 0.9 so high probability but for the unfair one though there is a small probability but it might also appear some point right so the probability of uh selecting 10 heads in a row would then be either you would get a Fair coin and toss 10 head continuously so this is one possib the second possibility is to select an unfair coin where the possibility of head is like 100% because there are both the sides of the coin is head so the probability of selecting 10 heads in a row would be this selecting Fair coin multiplied by probability of selecting 10 heads which is nothing but each coin which you are picking up is independent of each other getting a head there is also independent there so the probability is 0.5 that's why we are able to multiply it so you have here uh the probability of uh picking a Fair coin to be 0.9 and multiply that with 0.5 10 times and that's your like probability which you get after that so this probability of a is uh selecting a fire coin and getting 10 heads and the probability of B is selecting an unfire coin and we know whenever we select that the shity is we always get a head so then the probability of B becomes 0.001 so now what we need to find out is this probability where we can sort of say given uh we have these two cases is what is the probability that we are able to come out with the 11th head right so how we going to do that is by selecting this uh kind of combining this probabilities into a sort of form like this where we are calculating given these two possible cases what is the sort of likelihood of with a Fair coin getting 10 heads and with an unfair coin getting that one head right so those two are the probabilities return here 0 0.49 and 0.50 so finally with these two probabilities known to us the probability of selecting one more head would mean that uh in the Fair coin the probability is 0.5 right so which you already know and in the unfair coin the probability is always going to be one because we have both the sides as head and both of these probabilities we are just going to multiply with the probability of the fact that already 10 coins have been seen and it's head right so that's what we are like multiplying in front of it so if you'll put this into one formulation you will finally get the probability of selecting another head is 0.75 so which is like slightly more if you do didn't had this uh sort of one double-headed coin if that coin would not have been present the probability would be a bit more uh less here because all the coins are then Fair okay so thanks a lot for uh listening to this session hope this helps for you to prepare for your interviews so reiterating the fact give a very good emphasis on basic ideas from stats and probability also spend some amount of time understanding machine learning models and basic ways of doing data analysis and uh things like AB framework testing and so on so these are some broad Concepts you need to know also spend some time on linear algebra kind of ideas like The Egan values and Egan vectors it might also be helpful on certain questions so all the very best for your interview and uh hope you all get a really really successful carrier in data science thank you

Original Description

🔥𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐃𝐚𝐭𝐚 𝐒𝐜𝐢𝐞𝐧𝐜𝐞 𝐰𝐢𝐭𝐡 𝐏𝐲𝐭𝐡𝐨𝐧 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐂𝐨𝐮𝐫𝐬𝐞 : https://www.edureka.co/data-science-python-certification-course (𝐔𝐬𝐞 𝐂𝐨𝐝𝐞: 𝐘𝐎𝐔𝐓𝐔𝐁𝐄𝟐𝟎) This Data Science Interview Questions and Answers video will help you to prepare yourself for Data Science and Big Data Analytics interviews. This video is ideal for both beginners as well as professionals who want to learn or brush up their concepts in Data Science, Big Data Analytics and Machine Learning. 🔴 Subscribe to our channel to get video updates. Hit the subscribe button above: https://goo.gl/6ohpTV 📝Feel free to share your comments below.📝 🔴 𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐎𝐧𝐥𝐢𝐧𝐞 𝐓𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐚𝐧𝐝 𝐂𝐞𝐫𝐭𝐢𝐟𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬 🔵 DevOps Online Training: http://bit.ly/3VkBRUT 🌕 AWS Online Training: http://bit.ly/3ADYwDY 🔵 React Online Training: http://bit.ly/3Vc4yDw 🌕 Tableau Online Training: http://bit.ly/3guTe6J 🔵 Power BI Online Training: http://bit.ly/3VntjMY 🌕 Selenium Online Training: http://bit.ly/3EVDtis 🔵 PMP Online Training: http://bit.ly/3XugO44 🌕 Salesforce Online Training: http://bit.ly/3OsAXDH 🔵 Cybersecurity Online Training: http://bit.ly/3tXgw8t 🌕 Java Online Training: http://bit.ly/3tRxghg 🔵 Big Data Online Training: http://bit.ly/3EvUqP5 🌕 RPA Online Training: http://bit.ly/3GFHKYB 🔵 Python Online Training: http://bit.ly/3Oubt8M 🌕 Azure Online Training: http://bit.ly/3i4P85F 🔵 GCP Online Training: http://bit.ly/3VkCzS3 🌕 Microservices Online Training: http://bit.ly/3gxYqqv 🔵 Data Science Online Training: http://bit.ly/3V3nLrc 🌕 CEHv12 Online Training: http://bit.ly/3Vhq8Hj 🔵 Angular Online Training: http://bit.ly/3EYcCTe 🔴 𝐄𝐝𝐮𝐫𝐞𝐤𝐚 𝐑𝐨𝐥𝐞-𝐁𝐚𝐬𝐞𝐝 𝐂𝐨𝐮𝐫𝐬𝐞𝐬 🔵 DevOps Engineer Masters Program: http://bit.ly/3Oud9PC 🌕 Cloud Architect Masters Program: http://bit.ly/3OvueZy 🔵 Data Scientist Masters Program: http://bit.ly/3tUAOiT 🌕 Big Data Architect Masters Program: http://bit.ly/3tTWT0V 🔵 Machine
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from edureka! · edureka! · 0 of 60

← Previous Next →
1 ChatGPT Not Working - 4 Fixes | How To Fix ChatGPT Not Working | Why Is ChatGPT Not Working |Edureka
ChatGPT Not Working - 4 Fixes | How To Fix ChatGPT Not Working | Why Is ChatGPT Not Working |Edureka
edureka!
2 Advanced Java script Tutorial | JavaScript Training | JavaScript Programming | Edureka Rewind
Advanced Java script Tutorial | JavaScript Training | JavaScript Programming | Edureka Rewind
edureka!
3 Java script interview question and answers | Java script training | Edureka Rewind
Java script interview question and answers | Java script training | Edureka Rewind
edureka!
4 OpenAI API Tutorial using Python | How to use OpenAI GPT-3 API - Ada Babbage Curie Davinci | Edureka
OpenAI API Tutorial using Python | How to use OpenAI GPT-3 API - Ada Babbage Curie Davinci | Edureka
edureka!
5 What is Unsupervised Learning ? | Unsupervised Learning Algorithms| Machine Learning | Edureka
What is Unsupervised Learning ? | Unsupervised Learning Algorithms| Machine Learning | Edureka
edureka!
6 Top 10 Applications of Machine Learning in 2023 | Machine Learning  Training | Edureka Rewind - 7
Top 10 Applications of Machine Learning in 2023 | Machine Learning Training | Edureka Rewind - 7
edureka!
7 Machine Learning Engineer Career Path in 2023  | Machine Learning Tutorial | Edureka Rewind - 6
Machine Learning Engineer Career Path in 2023 | Machine Learning Tutorial | Edureka Rewind - 6
edureka!
8 10 Must Have Machine Learning Engineer Skills That Will Get You Hired   | Edureka Rewind - 7
10 Must Have Machine Learning Engineer Skills That Will Get You Hired | Edureka Rewind - 7
edureka!
9 Data Structures in Python | Data Structures and Algorithms in Python | Edureka | Python Live - 5
Data Structures in Python | Data Structures and Algorithms in Python | Edureka | Python Live - 5
edureka!
10 Python Lists | List in Python | Python Training  | Edureka  Rewind
Python Lists | List in Python | Python Training | Edureka Rewind
edureka!
11 Predictive Analysis Using Python | Learn to Build Predictive Models | Python Training | Edureka
Predictive Analysis Using Python | Learn to Build Predictive Models | Python Training | Edureka
edureka!
12 Machine Learning Tutorial | Machine Learning Algorithm | Machine Learning Engineer Program | Edureka
Machine Learning Tutorial | Machine Learning Algorithm | Machine Learning Engineer Program | Edureka
edureka!
13 How to use Pandas in Python | Python Pandas Tutorial  | Python Tutorial  |  Edureka  Rewind
How to use Pandas in Python | Python Pandas Tutorial | Python Tutorial | Edureka Rewind
edureka!
14 Parameters in Tableau | Tableau Parameters Examples | Tableau Tutorial  | Edureka Rewind
Parameters in Tableau | Tableau Parameters Examples | Tableau Tutorial | Edureka Rewind
edureka!
15 Top 10 Reasons to Learn Tableau in 2023  | Tableau Certification | Tableau | Edureka Rewind
Top 10 Reasons to Learn Tableau in 2023 | Tableau Certification | Tableau | Edureka Rewind
edureka!
16 Tableau Developer Roles & Responsibilities | Become A Tableau Developer | Tableau | Edureka Rewind
Tableau Developer Roles & Responsibilities | Become A Tableau Developer | Tableau | Edureka Rewind
edureka!
17 Deep Learning With Python | Deep Learning Tutorial For Beginners | Edureka  Rewind
Deep Learning With Python | Deep Learning Tutorial For Beginners | Edureka Rewind
edureka!
18 Realtime Object Detection  | Object Detection with TensorFlow | Edureka | Deep Learning Rewind - 2
Realtime Object Detection | Object Detection with TensorFlow | Edureka | Deep Learning Rewind - 2
edureka!
19 Top 20 Tableau Tips and Tricks in 20 Minutes | Tableau Tutorial | Tableau Training  | Edureka Rewind
Top 20 Tableau Tips and Tricks in 20 Minutes | Tableau Tutorial | Tableau Training | Edureka Rewind
edureka!
20 Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind -  5
Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind - 5
edureka!
21 ReactJS Installation Tutorial | ReactJS Installation On Windows | ReactJS Tutorial | Edureka Rewind
ReactJS Installation Tutorial | ReactJS Installation On Windows | ReactJS Tutorial | Edureka Rewind
edureka!
22 Phases in Cybersecurity  | Cybersecurity Training | Edureka | Cybersecurity Rewind - 2
Phases in Cybersecurity | Cybersecurity Training | Edureka | Cybersecurity Rewind - 2
edureka!
23 What Is React | ReactJS Tutorial for Beginners | ReactJS Training | Edureka Rewind
What Is React | ReactJS Tutorial for Beginners | ReactJS Training | Edureka Rewind
edureka!
24 Cybersecurity Frameworks Tutorial | Cybersecurity Training | Edureka | Cybersecurity Rewind- 2
Cybersecurity Frameworks Tutorial | Cybersecurity Training | Edureka | Cybersecurity Rewind- 2
edureka!
25 React vs Angular 4  | Angular 2 vs React | React & Angular | ReactJS Training | Edureka Rewind - 5
React vs Angular 4 | Angular 2 vs React | React & Angular | ReactJS Training | Edureka Rewind - 5
edureka!
26 ReactJS Components Life-Cycle Tutorial  | React Tutorial for Beginners  | Edureka Rewind
ReactJS Components Life-Cycle Tutorial | React Tutorial for Beginners | Edureka Rewind
edureka!
27 Ethical Hacking using Kali Linux | Ethical Hacking Tutorial | Edureka | Cybersecurity Rewind - 3
Ethical Hacking using Kali Linux | Ethical Hacking Tutorial | Edureka | Cybersecurity Rewind - 3
edureka!
28 Types Of Artificial Intelligence | Artificial Intelligence Explained | What is AI? | Edureka
Types Of Artificial Intelligence | Artificial Intelligence Explained | What is AI? | Edureka
edureka!
29 Top 10 Applications Of Artificial Intelligence in 2023 | Artificial Intelligence| Edureka Rewind
Top 10 Applications Of Artificial Intelligence in 2023 | Artificial Intelligence| Edureka Rewind
edureka!
30 The Future of AI | How will Artificial Intelligence Change the World in 2023? | Edureka Rewind
The Future of AI | How will Artificial Intelligence Change the World in 2023? | Edureka Rewind
edureka!
31 What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginners | Edureka Rewind
What is Artificial Intelligence | Artificial Intelligence Tutorial For Beginners | Edureka Rewind
edureka!
32 Google Cloud IAM | Identity & Access Management on GCP  | Edureka | GCP Rewind - 5
Google Cloud IAM | Identity & Access Management on GCP | Edureka | GCP Rewind - 5
edureka!
33 Google Cloud AI Platform Tutorial | Google Cloud AI Platform   | GCP Training | Edureka Rewind
Google Cloud AI Platform Tutorial | Google Cloud AI Platform | GCP Training | Edureka Rewind
edureka!
34 Projects in Google Cloud Platform  | GCP Project Structure  | GCP Training | Edureka Rewind
Projects in Google Cloud Platform | GCP Project Structure | GCP Training | Edureka Rewind
edureka!
35 How to Become a Data Scientist | Data Scientist Skills | Data Science Training  | Edureka Rewind - 3
How to Become a Data Scientist | Data Scientist Skills | Data Science Training | Edureka Rewind - 3
edureka!
36 Agglomerative and Divisive Hierarchical Clustering Explained | Data Science Training | Edureka Live
Agglomerative and Divisive Hierarchical Clustering Explained | Data Science Training | Edureka Live
edureka!
37 Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind -  5
Climate Change Prediction using Time Series | Python Projects | Edureka | DS Rewind - 5
edureka!
38 Data Science Project - Covid-19 Data Analysis | Python Training | Edureka | DS Rewind - 6
Data Science Project - Covid-19 Data Analysis | Python Training | Edureka | DS Rewind - 6
edureka!
39 What is Honeycode? | Introduction to Honeycode | Edureka
What is Honeycode? | Introduction to Honeycode | Edureka
edureka!
40 Difference between Amazon AWS and Google Cloud | GCP Training Google Cloud | Edureka Live
Difference between Amazon AWS and Google Cloud | GCP Training Google Cloud | Edureka Live
edureka!
41 DevOps Lifecycle | Introduction To DevOps | DevOps Tools | What is DevOps? | Edureka Rewind
DevOps Lifecycle | Introduction To DevOps | DevOps Tools | What is DevOps? | Edureka Rewind
edureka!
42 Introduction to DevOps | DevOps Tutorial for Beginners | DevOps Tools | DevOps | Edureka Rewind
Introduction to DevOps | DevOps Tutorial for Beginners | DevOps Tools | DevOps | Edureka Rewind
edureka!
43 How to Create Login System using Python | Python Programming Tutorial | Edureka Rewind
How to Create Login System using Python | Python Programming Tutorial | Edureka Rewind
edureka!
44 Python Developer | How to become Python Developer | Python Tutorial  | Edureka Rewind
Python Developer | How to become Python Developer | Python Tutorial | Edureka Rewind
edureka!
45 How to become a Data Engineer | Complete Roadmap to become a Data Engineer| Data Engineer |  Edureka
How to become a Data Engineer | Complete Roadmap to become a Data Engineer| Data Engineer | Edureka
edureka!
46 Azure Data Engineer Certification [DP 203] | How to Become Azure Data Engineer [2023] | Edureka
Azure Data Engineer Certification [DP 203] | How to Become Azure Data Engineer [2023] | Edureka
edureka!
47 Data Analyst vs Data Engineer vs Data Scientist | Data Analytics Masters Program  | Edureka Rewind
Data Analyst vs Data Engineer vs Data Scientist | Data Analytics Masters Program | Edureka Rewind
edureka!
48 DevOps Engineer day-to-day Activities | DevOps Engineer Responsibilities | Edureka Rewind
DevOps Engineer day-to-day Activities | DevOps Engineer Responsibilities | Edureka Rewind
edureka!
49 How to Become a DevOps Engineer?  | DevOps Engineer Roadmap | Edureka | DevOps Rewind
How to Become a DevOps Engineer? | DevOps Engineer Roadmap | Edureka | DevOps Rewind
edureka!
50 How to Become a Data Engineer? | Data Engineering Training | Edureka
How to Become a Data Engineer? | Data Engineering Training | Edureka
edureka!
51 How To Become A Big Data Engineer? | Big Data Engineer Roadmap | Edureka Rewind
How To Become A Big Data Engineer? | Big Data Engineer Roadmap | Edureka Rewind
edureka!
52 Python Integration for Power BI and Predictive Analytics | Power BI Training | Edureka
Python Integration for Power BI and Predictive Analytics | Power BI Training | Edureka
edureka!
53 Power BI KPI Indicators Tutorial | Custom Visuals In Power BI | Power BI Training  | Edureka Rewind
Power BI KPI Indicators Tutorial | Custom Visuals In Power BI | Power BI Training | Edureka Rewind
edureka!
54 Apache HBase Tutorial For Beginners | What is Apache HBase? | Big Data Training | Edureka Rewind
Apache HBase Tutorial For Beginners | What is Apache HBase? | Big Data Training | Edureka Rewind
edureka!
55 Big Data Hadoop Tutorial For Beginners  | Hadoop Training | Big Data Tutorial  | Edureka  Rewind
Big Data Hadoop Tutorial For Beginners | Hadoop Training | Big Data Tutorial | Edureka Rewind
edureka!
56 Big Data Analytics  | Big Data Analytics Use-Cases | Big Data Tutorial | Edureka Rewind
Big Data Analytics | Big Data Analytics Use-Cases | Big Data Tutorial | Edureka Rewind
edureka!
57 What Is Power BI? | Introduction To Microsoft Power BI | Power BI Training  | Edureka  Rewind
What Is Power BI? | Introduction To Microsoft Power BI | Power BI Training | Edureka Rewind
edureka!
58 Triggers in Salesforce | Salesforce Apex Triggers | Salesforce  Tutorial  | Edureka Rewind
Triggers in Salesforce | Salesforce Apex Triggers | Salesforce Tutorial | Edureka Rewind
edureka!
59 How To Become A Salesforce Developer | Salesforce For Beginners| Salesforce Training  Edureka Rewind
How To Become A Salesforce Developer | Salesforce For Beginners| Salesforce Training Edureka Rewind
edureka!
60 Java ArrayList Tutorial | Java ArrayList Examples | Java Tutorial | Edureka Rewind
Java ArrayList Tutorial | Java ArrayList Examples | Java Tutorial | Edureka Rewind
edureka!

Related Reads

📰
12.4 Million US Business Registrations Are Sitting on State Open-Data Portals, Free
Unlock 12.4 million US business registrations for free from state open-data portals and boost your business intelligence
Dev.to · Brad Ju
📰
Mau Naik Level? Ini Advanced Data Science Techniques untuk Data Analytics
Learn advanced data science techniques for data analytics to improve business decision-making
Medium · Data Science
📰
I Finally Understood AWS Data Pipelines After Following a Single Customer Click
Learn how to understand AWS Data Pipelines by following a customer click, making it easier to design and implement data workflows
Dev.to · Anupa Supul
📰
Beyond the Basics: Streamlit, Dash, and Bokeh for Interactive Dashboards
Learn to create interactive dashboards with Streamlit, Dash, and Bokeh, going beyond basic data visualization tools
Dev.to · RoyserVillanueva
Up next
ChatGPT Will Make Your Excel & Google Sheets x10 Better!
Educraft
Watch →