Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Ranjana Admin

Ranjana Admin

★ JanBask Expert
Share
131Questions
736Answers
177.6KViews on questions

Explain coefficient of determination in a linear regression model

Coefficient of determination or R2 or also goodness of fit is the key output used in regression analysis. It can tell the proportion of variance in target variables predicted from the features or attributes. It is the square of the correlation between actual and predicted output in a regression model.it always ranges…

Data Science

Answered Jan 15, 2020 · 1.9K Views Read answer →

How to implement linear regression using keras.Explain with a case study

Let us load housing data to perform linear regression using keras. import matplotlib.pyplot as plt import pandas as pd import numpy as np Now we will load the data df = pd.read_csv('../data/housing-data.csv') Now we create feature and target variables X = df[['sqft', 'bdrms', 'age']].values y = df['price'].values Now…

Data Science

Answered Jan 15, 2020 · 2.2K Views Read answer →

How to sort and order a dataframe in Python?

For sorting and ordering a dataframe, we need to create a dataframe. import pandas as pd df=pd.DataFrame({'col2':[444,555,666,444],'col3':['abc','def','ghi','xyz']}) df.head() Now we sort and order the dataframe df.sort_values(by='col2')

Data Science

Answered Jan 15, 2020 · 1.4K Views Read answer →

Explain how to select data from multiple columns based on criteria.

For selecting multiple data based on criteria, we have to create a simple dataframe to illustrate the dataset. import pandas as pd df = pd.DataFrame({'col1':[1,2,3,4],'col2':[444,555,666,444],'col3':['abc','def','ghi','xyz']}) df.head() Now we Select from DataFrame using criteria from multiple columns newdf = df[(df[&#

Data Science

Answered Jan 15, 2020 · 1.7K Views Read answer →

How to perform a group by function in Python?

To perform a groupby function, we need to create a dataframe.Let us create a dataframe. import pandas as pd # Create dataframe data = {'Company':['GOOG','GOOG','MSFT','MSFT','FB','FB'], 'Person':['Sam','Charlie','Amy','Vanessa','Carl','Sarah'], 'Sales':[200,120,340,124,243,3

Data Science

Answered Jan 15, 2020 · 2.2K Views Read answer →

A user has 10 k means Clusters from a data set and wants to build 10 linear regression models with all these clusters separately. How to do this using loops in R?

Yes DML operations (update/insert/ delete) are allowed in the procedure also (DDL: such as create/ alter/drop/ truncate) is also allowed in the procedures. In case if the procedure will get executed in parallel then DDL on a permanent table is not recommended as there could be chances that one procedure has already…

Data Science

Answered Jan 15, 2020 · 1.7K Views Read answer →

A user has the following code and got a linear regression fit with m=-0.1071 and b=0.0347.How to get deviation from m value?

We can get the deviation in the form of standard error from the following code import numpy as np import pandas as pd import statsmodels.api as sm import math U = [12.5, 10.0, 7.6, 6.0, 4.4, 3.1, 2.5, 1.5, 1.0, 0.5, 0.3] U_0 = 12.5 y = [] for number in U: y.append(math.log(number/U_0, math.e)) y = np.array(y) t =…

Data Science

Answered Jan 15, 2020 · 1.7K Views Read answer →

A user wants to use principal component analysis to reduce some noise before applying linear regression.He has 1000 samples and 200 features but he receives an error.

import numpy as np from sklearn.linear_model import LinearRegression from sklearn.decomposition import PCA X = np.random.rand(1000,200) y = np.random.rand(1000,1) model.fit(X,y) pca = PCA(n_components=8) pca.fit(X) PCA(copy=True, iterated_power='auto', n_components=3, random_state=None, svd_solver='auto', tol=0.0,…

Data Science

Answered Jan 15, 2020 · 1.5K Views Read answer →

More members from the SQL Server community

Learners asking and answering questions on the same topics — follow their questions and join in.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.