Tutor profile: Debkrishna M.
Subject: R Programming
Explain the difference Between Matrix and Dataframe in R.
Both are tabulated structures ie. Row vs Column structure. But the fundamental difference is that matrix can contain only similar types of data (e.g. numeric ) and Dataframe can contain many types of data simultaneously. Which means in one Dataframe, we can get numeric, integer, character, etc. For mathematical operations like matrix multiplication, inverse, etc we use matrix. For Data related operations like storing, manipulating, accessing or joining we will be using Dataframe.
Subject: Python Programming
A = np.array ( [ [ [ 3, 4, 5 ] ] ] ) B = np.array ( [ 5 ] ) C = A + B What will be the value of C ? Explain.
In any type of mathematical operation between numpy arrays, if the shape of any participating array is not sufficient then the Broadcasting rule applies. Rule 1: The compiler will add one extra rank to the array with a smaller rank until both participating rank matches. Compiler will make B as np.array( [ [ [ 5 ] ] ] ) now A and B has same rank. Rule 2; Now the element of smaller no of dimension of will be repeated untill no of element in that particular dimension mathes with another participating array. Compiler will make B as np.array( [ [ [ 5, 5, 5 ] ] ]) Now , C will be np.array ( [ [ [ 8, 9 , 10 ] ] ] )
In the context of Regression theory, explain the difference between Outlier, leverage, and Influential Point.
Lets for simple linear regression, Y- Dependent Variable X- Independent variable Regression Equation Y = a + bX + e ; e - error term Extreme Value of Y - Outlier point Extreme Value of X - Leverage point. Now if a point significantly changes a regression line that is called an Influential point. That is inclusion or exclusion of that point hugely changes the regression line. Now, an outlier point may or may not be an influential point. Similarly, a leverage point may or may not be an influential point. A Point will be an influential point or not depends on the location of the point on the regression plane.
needs and Debkrishna will reply soon.