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.0K Views
·
Answered ✓
S
Asked by: Sneha Pandey · 6 years ago
if A>0.4 then if B0.8 then class='X' In order to extract the decision rules, we can use the following code. from sklearn.tree import _tree def…
Data Science · Machine Learning
1 Answer
·
1.5K Views
·
Answered ✓
A
Asked by: Ashish Sinha · 6 years ago
Reading all the lines at a time is possible but can be ricky so to process the line one at a time for reading, we can do the following processFile =…
Data Science · R
1 Answer
·
1.3K Views
·
Answered ✓
U
Asked by: Uditi singh · 6 years ago
To iterate over a list, we have to define a list li
Data Science · R
1 Answer
·
1.4K Views
·
Answered ✓
U
Asked by: Uditi singh · 6 years ago
Let us assign all the recorded time in a variable x=c(17,16,20,24,22,15,21,15,17,22) To find out the time he commuted 20 minutes or more, we can do…
Data Science · R
1 Answer
·
904 Views
·
Answered ✓
A
Asked by: Amit jaisawal · 6 years ago
Let us assume the following vector count_list
Data Science · R
1 Answer
·
1.6K Views
·
Answered ✓
N
Asked by: Nishimura Asato · 6 years ago
In R, names() function is used to assign names to each element in a vector. Let us assign a vector named temps which contains temperature of seven…
Data Science
1 Answer
·
1.6K Views
·
Answered ✓
O
Asked by: Okamoto Bando · 6 years ago
We will read the dataset which is a bank data bank
Data Science
1 Answer
·
1.4K Views
·
Answered ✓
S
Asked by: shukhdev singh · 6 years ago
A data frame is a structure having 2 dimensions which contains data in the form or rows and columns.It is like a spreadsheet or dictionaries of…
Data Science
1 Answer
·
1.4K Views
·
Answered ✓
S
Asked by: shukhdev singh · 6 years ago
The approach we can usually use is to manipulate the factor values so we can plug them into the hcl() function. First, some raw data:…
Data Science · R
1 Answer
·
1.2K Views
·
Answered ✓
I
Asked by: Isha Patil · 2028 years ago