Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Niharika Deshpande

Niharika Deshpande

Community Learner
Share
11Questions
11Answers
12.3KViews on questions

What is a NullPointerException, and how do I fix it?

A NullPointerException (NPE) in Java is a runtime error that occurs when you try to use an object reference that hasn’t been initialized (i.e., it's null). This usually happens when calling a method, accessing a field, or performing operations on a null object, and it’s one of the most common bugs Java developers run…

Java

Answered May 15, 2025 · 595 Views Read answer →

Explain how to use tf-idf in R?

We can implement in R after importing following librariesWe will perform the following operation on the doc sentence.We get the following output in the matrix form

Data Science

Answered Dec 24, 2019 · 1.1K Views Read answer →

How to implement one-hot encoding in Python and in R?

One-hot encoding is used to transform the categorical variables into dummy variables which is used in order to fit in the model. In Python To implement one-hot encoding in Python, we use the following import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset dataset =…

Data Science

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

Explain concordance with example.

It is a process of measuring quality of fit for a binary outcome in a model. It is a proportion of pairs in which the predicted event probability is higher for the actual event than non-event. Let us take the following example to explain the concept. In the following table, both actual and predicted values are shown…

Data Science

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

How to merge two lists in R?Explain with example

Let us define two lists and merge it. A list can contain an array of elements of any data types be it integer, character or float. first_list = list(a = 1, b = 2, c = 3) second_list = list(a = 2, b = 3, c = 4) To merge it, we can apply mapply() mapply() is a function which can be applied to multiple lists or vector…

Data Science

Answered Nov 9, 2019 · 992 Views Read answer →

A user is currently viewing the decision tree using the following code. Is there a way that we can export some calculated fields as output too?

For example, is it possible to display the sum of an input attribute at each node, i.e. sum of feature 1 from 'X' data array in the leaves of the tree. from sklearn import datasets iris = datasets.load_iris() X = iris.data[:] y = iris.target #%% from sklearn.tree import DecisionTreeClassifier…

Data Science

Answered Nov 7, 2019 · 859 Views Read answer →

Is cross entropy always larger than entropy?

import numpy as np p = [0.5, 0.2, 0.2, 0.1] q_1 = [0.4, 0.2, 0.2, 0.2] q = [0.4, 0.2, 0.2, 0.2] def cross_entropy(p, q): return np.sum(-1*np.multiply(p, np.log(q))) # Get cross entropy print(cross_entropy(p, q)) # Get entropy

Data Science

Answered Nov 4, 2019 · 1.0K 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.