Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scikit learn decistion tree

from sklearn import tree
X = [[0, 0], [1, 1]]
Y = [0, 1]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, Y)
Comment

scikit learn decistion tree

>>> from sklearn.datasets import load_iris
>>> from sklearn.model_selection import cross_val_score
>>> from sklearn.tree import DecisionTreeClassifier
>>> clf = DecisionTreeClassifier(random_state=0)
>>> iris = load_iris()
>>> cross_val_score(clf, iris.data, iris.target, cv=10)
...                             
...
array([ 1.     ,  0.93...,  0.86...,  0.93...,  0.93...,
        0.93...,  0.93...,  1.     ,  0.93...,  1.      ])
Comment

PREVIOUS NEXT
Code Example
Python :: int to byte array python 
Python :: ascii to int python 
Python :: python find index 
Python :: flask or django 
Python :: python get colorscale 
Python :: pair plot seaborn 
Python :: python program to check whether a specified value is contained in a group of values 
Python :: selenium screenshot python user agent 
Python :: inicio programacao python 
Python :: crawling emails with python 
Python :: reverse string python 
Python :: py random.sample 
Python :: NumPy fliplr Syntax 
Python :: change index function for class python 
Python :: viewset and router 
Python :: python logging change handler level 
Python :: discord chatterbot python 
Python :: python button graphics.py 
Python :: unity python 
Python :: calculate the R^2 for X and Y python 
Python :: flask get request port 
Python :: typer python 
Python :: pytest snapshot update 
Python :: combination in python 
Python :: pipeline model coefficients 
Python :: change edit last line python 
Python :: channel unhiding command in discord.py 
Python :: Roberta Inference TensorFlow 
Python :: df max count syntax 
Python :: hello world in python 3 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =