'Decision tree regression code, when run shows only 'random_state = 0' and nothing else
I have taken a house price dataset. I have run the following code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.tree import DecisionTreeRegressor
from sklearn.model_selection import train_test_split
data = pd.read_csv(r'C:\Users\indur\Desktop\Python projects\supervised-regression-project\datasets\houseprice.csv')
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.33, random_state=0)
dtr = DecisionTreeRegressor(random_state = 0)
dtr.fit(x_train, y_train)
This is the output I am getting:
DecisionTreeRegressor(random_state=0)
This is the output I want to get:
DecisionTreeRegressor(criterion = 'mse', max_depth=None, max_features=None, max_leaf_nodes=None, min_impurity_decrease=0.0, min_impurity_split=None, min_samples_leaf=1,min_samples_split=2, min_weight_fraction_leaf=0.0,presort=False, random_state=0, splitter='best')
How do I get the latter output?
Solution 1:[1]
From scikit-learn v0.23, the display configuration has to be set before like this:
from sklearn import set_config
set_config(print_changed_only=False)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Alex Serra Marrugat |