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 :: how to create a window in pygame 
Python :: python order list of dictionaries by value 
Python :: append multiple elements python 
Python :: convert dictionary to string 
Python :: readline python 
Python :: check how many letters in a string python 
Python :: panda 
Python :: how to create a for loop in python 
Python :: draw canvas in python 
Python :: loop python 
Python :: split long list into chunks of 100 
Python :: python ^ symbol 
Python :: python 3d software 
Python :: python ValueError: zero-size array to reduction operation maximum which has no identity 
Python :: how to convert lower case to upper case in python 
Python :: phone numbers 
Python :: if it is square python 
Python :: how to duplicate a row in python 
Python :: Python Loop Usage 
Python :: self python 
Python :: quiz game in python 
Python :: update python version pycharm 
Python :: raspbian run a python script at startup 
Python :: python sort a list by a custom order 
Python :: python string: immutable string 
Python :: print in pythin 
Python :: python palindrome program 
Python :: how to generate two random numbers in python 
Python :: python one sample t-test 
Python :: python linked list insert 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =