(trainingData, testData) = data.randomSplit([0.7, 0.3]) vecAssembler = VectorAssembler(inputCols=["_1", "_2", "_3", "_4", "_5", "_6", "_7", "_8",…
Data Science · Machine Learning
1 Answer
·
1.5K Views
·
Answered ✓
S
Asked by: Sanjana Shah · 6 years ago
First we import the data # Importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd # Importing the dataset…
Data Science · Machine Learning
2 Answers
·
1.8K Views
·
Answered ✓
V
Asked by: varsha Chauhan · 6 years ago
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…
Data Science · Machine Learning
1 Answer
·
1.5K Views
·
Answered ✓
G
Asked by: Gayatri Jaiteley · 6 years ago
Logistic regression and decision tree are both classification based algorithms but they are very different from each other Logistic regression looks…
Data Science · Machine Learning
1 Answer
·
962 Views
·
Answered ✓
A
Asked by: Aishwarya Jhadav · 6 years ago
Classification tree: tree(formula = High temperature ~ ., data = summer.train) Variables actually used in tree construction: [1] "Humidity" "Cloudy"…
Data Science · Machine Learning
1 Answer
·
1.4K Views
·
Answered ✓
V
Asked by: varsha Chauhan · 6 years ago
Siblings Children Gender Survival 1 Y Y F Y 2 N Y M N 3 Y Y M Y 4 N N F N 5 Y N F N
Data Science · Machine Learning
1 Answer
·
701 Views
·
Answered ✓
A
Asked by: Aishwarya Jhadav · 6 years ago
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…
Data Science · Machine Learning
1 Answer
·
1.0K Views
·
Answered ✓
N
Asked by: Niharika Deshpande · 6 years ago
KNN does not produce wrong results all the time. It largely depends on the dataset. There might be two reasons for this error. The training data…
Data Science · Machine Learning
1 Answer
·
1.6K Views
·
Answered ✓
N
Asked by: Naveen Yadav · 6 years ago
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…
Data Science · Machine Learning
3 Answers
·
7.2K Views
·
Answered ✓
G
Asked by: Gayatri Jaiteley · 6 years ago
from sklearn.datasets import load_iris from sklearn import tree X, y = load_iris(return_X_y=True) clf = tree.DecisionTreeClassifier() clf =…
Data Science · Machine Learning
1 Answer
·
1.4K Views
·
Answered ✓
V
Asked by: varsha Chauhan · 6 years ago
from sklearn import tree clf = tree.DecisionTreeClassifier() # [height, weight, shoe_size] X = [[181, 80, 44], [177, 70, 43], [160, 60, 38], [154,…
Data Science · Machine Learning
1 Answer
·
1.5K Views
·
Answered ✓
G
Asked by: Gayatri Jaiteley · 6 years ago
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 Science · Machine Learning
1 Answer
·
1.1K Views
·
Answered ✓
S
Asked by: Sneha Pandey · 6 years ago