Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Gayatri Jaiteley

Gayatri Jaiteley

Community Learner
Share
15Questions
13Answers
33.2KViews on questions

Git Push ERROR: Repository not found

In order to solve this issue include your username and password in the repo url: $ git clone https://yourusername:yourpassword@github.com/path_to/myRepos.gitNote: (git push repository not found) status code indicates that the origin server did not find a current representation for the target resource

Tableau

Answered Jul 10, 2021 · 4.6K Views Read answer →

PySpark: How to fill values in dataframe for specific columns?

Firstly, you have to create your dataframe: Now, in order to replace null values only in the first 2 columns - Column "a" and "b", and that too without losing the third column, you can use: df.fillna( { 'a':0, 'b':0 } )To pyspark fillna, follow the above mentioned steps.

Python

Answered Jun 12, 2021 · 2.0K Views Read answer →

A user is giving first steps with R and now he is testing the KNN classification method (package class), but he is struggling to put it to work. He has two DocumentTermMatrix, one for train and…

Let us create an empty list which will contain the training and testing accuracy and the respective k values. The following code will generate the k values along with the training and testing accuracy. # creating empty list variable acc = [] # running KNN algorithm for 3 to 50 nearest neighbours(odd numbers) and #…

Data Science

Answered Dec 20, 2019 · 1.7K Views Read answer →

A user has fitted a CountVectorizer to some documents in scikit-learn. He would like to see all the terms and their corresponding frequency in the text corpus, in order to select stop-words. For…

If cv is the CountVectorizer and X is the vectorized corpus, then the following code must work zip(cv.get_feature_names(), np.asarray(X.sum(axis=0)).ravel()) It will return a list of (term frequency) pairs for each distinct term in the corpus that the CountVectorizer extracted. But it won’t be in ordered format.…

Data Science

Answered Dec 11, 2019 · 1.6K Views Read answer →

How to visualize a model in Python?

We can import the following model # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset = pd.read_csv('Social_Network_Ads.csv') X = dataset.iloc[:, [2, 3]].values y = dataset.iloc[:, 4].values # Splitting the dataset into the Training set and…

Data Science

Answered Nov 30, 2019 · 1.5K Views Read answer →

A user ran the following code and received an error

import pandas as pd from sklearn.tree import DecisionTreeClassifier data = pd.DataFrame() data['A'] = ['a','a','b','a'] data['B'] = ['b','b','a','b'] data['C'] = [0, 0, 1, 0] data['Class'] = ['n','n','y','n'] tree =

Data Science

Answered Nov 9, 2019 · 1.4K Views Read answer →

What are the remedial actions to push the model towards the ideal region?

Models with either high bias or high variance error components do not produce the ideal fit. Hence, some makeovers are required to do so. In the following diagram, the various methods applied are shown in detail. In the case of linear regression, there would be a high bias component, meaning the model is not flexible…

Data Science

Answered Nov 5, 2019 · 1.5K Views Read answer →

How to calculate the error rate for a decision tree with R?

To calculate the error rate for a decision tree in R, assuming the mean computing error rate on the sample used to fit the model, we can use printcp(). > library(rpart) > fit printcp(fit) Classification tree: rpart(formula = Kyphosis ~ Age + Number + Start, data = kyphosis) Variables actually used in tree construction:

Data Science

Answered Nov 4, 2019 · 7.2K Views Read answer →

More members from the Data Science community

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

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.

Learn & Explore

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