CloudyML - Data Science & Analytics
46.6K subscribers
260 photos
54 videos
33 files
1.1K links
My Assignment Driven Data Science Courses
https://linktr.ee/cloudyml

My LinkedIn profile
https://www.linkedin.com/in/akashraj001

My Instagram
https://www.instagram.com/cloudyml.akash
Download Telegram
Today's Quiz -  What is backpropagation? How does it work? Why do we need it? ‍
Company Name -   EY

Role - Data Scientist



The Backpropagation algorithm looks for the minimum value of the error function in weight space using a technique called the delta rule or gradient descent. The weights that minimize the error function is then considered to be a solution to the learning problem.

We need backpropagation because,

Calculate the error – How far is your model output from the actual output.

Minimum Error – Check whether the error is minimized or not.

Update the parameters – If the error is huge then, update the parameters (weights and biases). After that again check the error.

Repeat the process until the error becomes minimum.

Model is ready to make a prediction – Once the error becomes minimum, you can feed some inputs to your model and it will produce the output.
**Today's Quiz -**

 Three zebras are sitting on each corner of an equilateral triangle. Each zebra randomly picks a direction and only runs along the outline of the triangle to either opposite edge of the triangle. What is the probability that none of the zebras collide?

Company Name -   Wipro

Role - Data Scientist**






• Let's imagine all of the zebras on an equilateral triangle. They each have two options of directions to go in if they are running along the outline to either edge. Given the case is random, let's compute the possibilities in which they fail to collide.



• There are only really two possibilities. The zebras will either all choose to run in a clockwise direction or a counter-clockwise direction.



• Let's calculate the probabilities of each. The probability that every zebra will choose to go clockwise will be the product of each zebra choosing the clockwise direction. Given there are two choices (counterclockwise or clockwise), that would be 1/2 * 1/2 * 1/2 = 1/8



• The probability of every zebra going counter-clockwise is the same at 1/8. Therefore, if we sum up the probabilities, we get the correct probability of 1/4 or 25%.
**Today's Quiz - If your model suffers from low bias and high variance, which algorithm would you use to tackle it? Why?

Company Name -   KPMG

Role - Data Scientist**



The error of a model can either be of bias and/or variance. Very low bias but high variance indicates overfitting, as well as complexity of the model. By averaging these out, we can reduce the variance and increase the bias.

a) A bagging algorithm can handle the high variance. The dataset is randomly subsampled mm times and the model trained using each subsample. Then the models are averaged by averaging out the predictions of each mode.

b) By using the k-nearest neighbour algorithm, the trade-off between bias and variance can be achieved. The value of k is increased to increase the number of neighbours that contribute to the prediction, and this in turn increases the bias of the model.

c) By using the support vector machine algorithm, the trade-off can be achieved by increasing the C parameter that influences the number of violations of the margin allowed in the training data, and this in turn increases the bias but decreases the variance.
**Today's Quiz - We know that one hot encoding increases the dimensionality of a dataset, but label encoding doesn’t. How?

Company Name -   JP Morgan

Role - Data Scientist**



• When we use one-hot encoding, there is an increase in the dimensionality of a dataset.
• The reason for the increase in dimensionality is that, for every class in the categorical variables, it forms a different variable.
• Example: Suppose, there is a variable ‘Color.’ It has three sub-levels as Yellow, Purple, and Orange. So, one hot encoding ‘Color’ will create three different variables as Color.Yellow, Color.Purple, and Color.Orange.
• In label encoding, the sub-classes of a certain variable get the value as 0 and 1. So, we use label encoding only for binary variables.
• This is the reason that one hot encoding increases the dimensionality of data and label encoding does not.
Some Data Science Internship opportunities for freshers:

1. Company: Hotstar
Role: Data Analyst
Experience: 1-3 years
Job link: https://lnkd.in/eAJd-gnd

2. Company: iAnalyst Infotech Pvt. Ltd.
Role: Data Scientist Intern
Experience: 0 years
Job link: https://lnkd.in/dDAT3wyb

3. Company: Emplay
Role: Data Science Intern
Experience: 0 years
Job link: https://lnkd.in/dwasDHqN

4. Company: Merkle
Role: Data Science- Analyst (Intern)
Experience: 0 years
Job link: https://lnkd.in/d_qtaqje

5. Company: Cisco
Role: Data Scientist - (Intern)
Experience: 0 years
Job link: https://lnkd.in/djJaVujF
**Today's Quiz - Two candidates Aman and Mohan appear for a Data Science Job interview. The probability of Aman cracking the interview is 1/8 and that of Mohan is 5/12. What is the probability that at least one of them will crack the interview?

Company Name -  TheMathCompany

Role - Data Scientist Trainee**





The probability of Aman getting selected for the interview is 1/8 P(A) = 1/8 The probability of Mohan getting selected for the interview is 5/12 P(B)=5/12
Now, the probability of at least one of them getting selected can be denoted at the Union of A and B, which means
P(A U B) =P(A)+ P(B) – (P(A ∩ B)) ………………………(1)
Where P(A ∩ B) stands for the probability of both Aman and Mohan getting selected for the job. To calculate the final answer, we first have to find out the value of P(A ∩ B) So, P(A ∩ B) = P(A) * P(B)
1/8 * 5/12
5/96
Now, put the value of P(A ∩ B) into equation 1
P(A U B) =P(A)+ P(B) – (P(A ∩ B))
1/8 + 5/12 -5/96
So, the answer will be 47/96.
**Today's Quiz - I know that a linear regression model is generally evaluated using Adjusted R² or F value. How would you evaluate a logistic regression model?

Company Name -  EY

Role - Data Scientist**





We can use the following methods:


• Since logistic regression is used to predict probabilities, we can use AUC-ROC curve along with confusion matrix to determine its performance.



• Also, the analogous metric of adjusted R² in logistic regression is AIC. AIC is the measure of fit which penalizes model for the number of model coefficients. Therefore, we always prefer model with minimum AIC value.



• Null Deviance indicates the response predicted by a model with nothing but an intercept. Lower the value, better the model. Residual deviance indicates the response predicted by a model on adding independent variables. Lower the value, better the model.
**Today's Quiz - How many iPhones are currently being used in India?

Company Name -  Ericsson

Role - Data Analyst**


Clarify with the interviewers whether the question is about only a single version of the iPhone or all versions put together. Here, we shall assume that all iPhones put together are being talked about.

The first step toward solving this query will be segmentation. There are many ways in which India’s population can be segmented. Here, we shall first assume that only people who have attained a working age and are under the age of retirement own an iPhone. Children and old citizens do not own an iPhone. This removes 20% of the population as children and 20% as senior citizens.

The next assumption will be that only the upper stratum of India’s income range can afford an iPhone. This metric assumes that only 5% of the eligible citizens from the previous filter can own an iPhone.

Now, it is not necessary that every member of this upper stratum will own an iPhone. Other options, such as OnePlus, Samsung, etc., are also available. However, a fair assumption would be that 50% of the eligible population from the previous filter owns an iPhone.

Calculating the proportion of the population that owns an iPhone – 
0.6 x 0.05 x 0.5 = 0.015
Total iPhones in India = 0.015 x 130 crore = 1.95 crore
**Today's Quiz - You have been asked to evaluate a regression model based on R², adjusted R² and tolerance. What will be your criteria?

Company Name -  Deloitte 

Role - Data Science Trainee**



Tolerance (1 / VIF) is used as an indicator of multicollinearity. It is an indicator of percent of variance in a predictor which cannot be accounted by other predictors. Large values of tolerance are desirable.

We will consider adjusted R² as opposed to R² to evaluate model fit because R² increases irrespective of improvement in prediction accuracy as we add more variables. 

But, adjusted R² would only increase if an additional variable improves the accuracy of model, otherwise stays same. It is difficult to commit a general threshold value for adjusted R² because it varies between data sets.

 For example: a gene mutation data set might result in lower adjusted R² and still provide fairly good predictions, as compared to a stock market data where lower adjusted R² implies that model is not good.
👇Key Highlights of this Course:

☑️ Assignments-based learning for Hands-on experience and Confidence build-up.

☑️25+ Assignments have nicely curated questions to cover all the important topics of Python, Machine Learning, SQL, Statistics, Model Deployment and AWS (SageMaker, Lambda Functions, API Gateway).

☑️10+ Data Science end to end Capstone Projects that you can put in your Resume.

☑️1-1 Skype course support mentorship available from 10 am to 10 pm every day (including weekends) to resolve Course,Assignment and Project related queries.

☑️250+ Frequently asked Interview Questions and answers PDF Collection

☑️Self Paced Course with Lifetime access

☑️Reference videos and blog collections in a structured way to learn all the Concepts.

☑️Get Data Science Interview Questions and Answers in the form of Newsletters daily.

☑️Suitable even for beginners with no prior coding experience

☑️Final Course Completion Certificate.

Course link: https://rzp.io/l/mfGimAk
Today's Interview Quest

Company Name- Capital One
Role- Data Scientist

Q. How would you build a model to predict credit card fraud?
A. Use Kaggle's Credit card fraud dataset, start with EDA (Exploratory Data Analysis). Applying train, test split over the data and then finally choosing any model like logistic regression, XGBoost or Random Forest. After Hyperparameter tuning and fitting the model, the final step would be evaluating its performance.

Q. How would you derive new features from features that already exist?
A. Feature engineering is applied first to generate additional features, and then feature selection is done to eliminate irrelevant, redundant, or highly correlated features. This includes techniques like Binning, Data manipulation etc.

Q. If you’re attempting to predict a customer’s gender, and you only have 100 data points, what problems could arise?
A. Overfitting because we might learn too much into some particular patterns within this small sample set so we lose generalization abilities on other datasets.

Q. Suppose you were given two years of transaction history. What features would you use to predict credit risk?
A. Following are the features that can be used in such case.
Transaction amount,
Transaction count,
Transaction frequency,
transaction category: bar, grocery, jwery etc.
transaction channels: credit card, debit card, international wire transfer etc.
distance between transaction address and mailing address,
fraud/ risk score

Q. Explain overfitting and what steps you can take to prevent it.
A. Overfitting happens when a model learns the detail and noise in the training data to the extent that it negatively impacts the performance of the model on new data. Some steps that we can take to avoid it:
1. Data augmentation
2. L1/L2 Regularization
3. Remove layers / number of units per layer
4. Cross-validation

Q. Why does SVM need to maximize the margin between support vectors?
A. Our goal is to maximize the margin because the hyperplane for which the margin is maximum is the optimal hyperplane. Thus SVM tries to make a decision boundary in such a way that the separation between the two classes is as wide as possible in the plane.
Today's Interview Quest

Company Name - Cognizant
Role - Data Scientist


Q. Describe how Gradient Boosting works.

A. Gradient boosting is a type of machine learning boosting. It relies on the intuition that the best possible next model, when combined with previous models, minimizes the overall prediction error. If a small change in the prediction for a case causes no change in error, then next target outcome of the case is zero. Gradient boosting produces a prediction model in the form of an ensemble of weak prediction models, typically decision trees.


Q. Describe the decision tree model.

A. Decision Trees are a type of Supervised Machine Learning where the data is continuously split according to a certain parameter. The leaves are the decisions or the final outcomes. A decision tree is a machine learning algorithm that partitions the data into subsets.


Q. What is a neural network?

A. Neural networks are a set of algorithms, modeled loosely after the human brain, that are designed to recognize patterns. They interpret sensory data through a kind of machine perception, labeling or clustering raw input. They, also known as Artificial Neural Networks, are the subset of Deep Learning.


Q. Explain the Bias-Variance Tradeoff

A. The bias–variance tradeoff is the property of a model that the variance of the parameter estimated across samples can be reduced by increasing the bias in the estimated parameters.


Q. What’s the difference between L1 and L2 regularization?

A. The main intuitive difference between the L1 and L2 regularization is that L1 regularization tries to estimate the median of the data while the L2 regularization tries to estimate the mean of the data to avoid overfitting. That value will also be the median of the data distribution mathematically.

Happy Learning
Today's Interview Quest

Company Name - Fractal
Role - Data Scientist


Q. Difference between array and list

A. The main difference between these two data types is the operation you can perform on them. Lists are containers for elements having differing data types but arrays are used as containers for elements of the same data type.



Q. Which is faster dictionary or list for look up

A. Dictionary is faster because you used a better algorithm. The reason is because a dictionary is a lookup, while a list is an iteration. Dictionary uses a hash lookup, while your list requires walking through the list until it finds the result from beginning to the result each time.



Q. How much time SVM takes to complete if 1 iteration takes 10sec for 1st class.
And there are 4 classes.

A. It would take 4*10 = 40 seconds to train one-vs-all method one to one.



Q. Kernals in svm, there difference

A. Kernel Function in SVM is a method used to take data as input and transform into the required form of processing data.

Gaussian Kernel Radial Basis Function (RBF) : It is used to perform transformation, when there is no prior knowledge about data and it uses radial basis method to improve the transformation.

Sigmoid Kernel: this function is equivalent to a two-layer, perceptron model of neural network, which is used as activation function for artificial neurons.

Polynomial Kernel: It represents the similarity of vectors in training set of data in a feature space over polynomials of the original variables used in kernel.

Linear Kernel: used when data is linearly separable.


Happy Learning with CloudyML💙
Today's Interview Quest

Company Name - Larsen and Toubro
Role - Data Scientist



Q. args will return?

A. The special syntax *args in function is used to pass a variable number of arguments to a function. It is used to pass a non-key worded, variable-length argument list. The syntax is to use the symbol * to take in a variable number of arguments; by convention, it is often used with the word args.


Q. Difference between having and where clause in SQL.

A. WHERE Clause is used to filter the records from the table based on the specified condition. HAVING Clause is used to filter record from the groups based on the specified condition.


Q. How do you handle categorical data?

A. One-Hot Encoding is the most common, correct way to deal with non-ordinal categorical data. It consists of creating an additional feature for each group of the categorical feature and mark each observation belonging (Value=1) or not (Value=0) to that group.


Q. What Is Interpolation And Extrapolation?

A. Interpolation is the process of calculating the unknown value from known given values whereas extrapolation is the process of calculating unknown values beyond the given data points.


Q. How do you handle null values and which Imputation method is more favorable?

A. Ways to handle missing values in the dataset:
1. Deleting Rows with missing values.
2. Using Algorithms that support missing values.
3. Prediction of missing values.
4. Multiple imputation is more advantageous than the single imputation because it uses several complete data sets and provides both the within-imputation and between-imputation variability.

Happy Learning with CloudyML 💙
https://youtu.be/tBdu-JZyANo

Finally a video with my face and nice editing 😁
Today's Interview Quest

Company Name - Deloitte
Role - Data Scientist



Q. Difference between Correlation and Regression.

A. The main difference in correlation vs regression is that the measures of the degree of a relationship between two variables; let them be x and y. Here, correlation is for the measurement of degree, whereas regression is a parameter to determine how one variable affects another.



Q. Why do we square the residuals instead of using modulus?

A. It is because of the extra penalty for higher errors and squaring the residuals for mean deviation were observed to be more efficient than mean absolute deviation.



Q. Which evaluation metric should you prefer to use for a dataset having a lot of outliers in it?

A. Mean Absolute Error(MAE) is preferred when we have too many outliers present in the dataset because MAE is robust to outliers whereas MSE and RMSE are very susceptible to outliers and these start penalizing the outliers by squaring the error terms.



Q. Heteroscedasticity? How to detect it?

A. Heteroskedasticity refers to situations where the variance of the residuals is unequal over a range of measured values. When running a regression analysis, heteroskedasticity results in an unequal scatter of the residuals (also known as the error term). To check for heteroscedasticity, you need to assess the residuals by fitted value plots specifically. Typically, the telltale pattern for heteroscedasticity is that as the fitted values increases, the variance of the residuals also increases.



Q. p-value?

A. A p-value is a measure of the probability that an observed difference could have occurred just by random chance. The lower the p-value, the greater the statistical significance of the observed difference. P-value can be used as an alternative to or in addition to pre-selected confidence levels for hypothesis testing.



Q. Root Cause Analysis?

A. Root cause analysis (RCA) is defined as a collective term that describes a wide range of approaches used to uncover causes of problems. Some RCA approaches are geared more toward identifying true root causes than others, some are more general problem-solving techniques, and others simply offer support for the core activity of root cause analysis.



Q. Regularization?

A. Regularization is the process which regularizes or shrinks the coefficients towards zero. In simple words, regularization discourages learning a more complex or flexible model, to prevent overfitting.



Q. DBSCAN Clustering?

A. Density-based spatial clustering of applications with noise (DBSCAN) is a well-known data clustering algorithm that is commonly used in data mining and machine learning. The main idea behind DBSCAN is that a point belongs to a cluster if it is close to many points from that cluster. It is able to find arbitrary shaped clusters and clusters with noise (i.e. outliers).

Happy Learning with CloudyML💙
Today's Interview Quest

Company Name - Wipro
Role - Data Scientist



Q. Difference between WHERE and HAVING in SQL

A. The main difference between them is that the WHERE clause is used to specify a condition for filtering records before any groupings are made, while the HAVING clause is used to specify a condition for filtering values from a group.


Q. Explain confusion matrix ?

A. A confusion matrix is a summary of prediction results on a classification problem. The number of correct and incorrect predictions are summarized with count values and broken down by each class.


Q. Explain PCA

A. The principal components are eigenvectors of the data's covariance matrix. Thus, the principal components are often computed by eigen decomposition of the data covariance matrix or singular value decomposition of the data matrix. PCA is the simplest of the true eigenvector-based multivariate analyses and is closely related to factor analysis.


Q. How do you cut a cake into 8 equal parts using only 3 straight cuts ?

A. Cut the cake from middle first, then pile up the one piece on another, and then again cut it straight from the middle which will leave you with 4 pieces. Finally, put all the 4 pieces on one another, and cut it for the third time. This is how with 3 straight cuts, you can cut cake into 8 equal pieces.


Q. Explain kmeans clustering

A. K-means clustering aims to partition data into k clusters in a way that data points in the same cluster are similar and data points in the different clusters are farther apart. Similarity of two points is determined by the distance between them.


Q. How is KNN different from k-means clustering?

A. K-means clustering represents an unsupervised algorithm, mainly used for clustering, while KNN is a supervised learning algorithm used for classification.


Q. Stock market prediction: You would like to predict whether or not a certain company will declare bankruptcy within the next 7 days (by training on data of similar companies that had previously been at risk of bankruptcy). Would you treat this as a classification or a regression problem?

A. It is a classification problem.


Happy Learning with CloudyML💙