Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

decision tree regressor

# Import DecisionTreeRegressor from sklearn.tree
from sklearn.tree import DecisionTreeRegressor

# Instantiate dt
dt = DecisionTreeRegressor(max_depth=8,
                           min_samples_leaf=0.13,
                           random_state=3)

# Fit dt to the training set
dt.fit(X_train, y_train)
Comment

scikit decision tree regressor

# import dataset
# dataset = pd.read_csv('Data.csv') 
# alternatively open up .csv file to read data
  
dataset = np.array(
[['Asset Flip', 100, 1000],
['Text Based', 500, 3000],
['Visual Novel', 1500, 5000],
['2D Pixel Art', 3500, 8000],
['2D Vector Art', 5000, 6500],
['Strategy', 6000, 7000],
['First Person Shooter', 8000, 15000],
['Simulator', 9500, 20000],
['Racing', 12000, 21000],
['RPG', 14000, 25000],
['Sandbox', 15500, 27000],
['Open-World', 16500, 30000],
['MMOFPS', 25000, 52000],
['MMORPG', 30000, 80000]
])
  
# print the dataset
print(dataset)
Comment

PREVIOUS NEXT
Code Example
Python :: python extend list 
Python :: delete certain characters from a string python 
Python :: multiple variables in for loop python 
Python :: python check if int 
Python :: python convert string to lowercase 
Python :: django content type 
Python :: python create sqlite db in memory 
Python :: extend a list python 
Python :: delete values with condition in numpy 
Python :: tkinter prevent window resize 
Python :: python count empty lines in text file 
Python :: python __init_subclass__ 
Python :: format number in python 
Python :: splitting a number into digits python 
Python :: python copy deep arrays without reference 
Python :: Simple Scatter Plot in matplotlib 
Python :: python remove punctuation 
Python :: import math sqrt python 
Python :: try except keyerror 
Python :: copyfile pyhon 
Python :: onehotencoder pyspark 
Python :: delete all elements in list python 
Python :: how to remove a string inside another string python 
Python :: how to custom page not found in django 
Python :: nn.dropout 
Python :: batchnorm1d pytorch 
Python :: move all files in directory with shutils 
Python :: datetime date from string 
Python :: python ip address is subnet of 
Python :: python lock using a file 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =