Menu
support@authoritypapers.com
+1(805) 568 7317

how can i resolve this error in 45 from sklearn tree import decisiontreeregres sor i 5149362

how can i resolve this error?


In [45]: from sklearn.tree import DecisionTreeRegres sor In [46]: from sklearn.metrics import mean_squared_error for depth in
H Run C Code random_state check_random_state (self . random_state) if check_input: X check_array (X, dtype-DTYPE, accept_spar In [45]: from sklearn.tree import DecisionTreeRegres sor In [46]: from sklearn.metrics import mean_squared_error for depth in range(1, 2) : model DecisionTreeRegressor (max_depth-depth) model.fit(X,Y) YP-model.predict (X) MSE-mean_squared_error (YP,Y) print (“The MSE for a depth of”, depth, “is”,MSE) ValueError Traceback (most recent call last) ipython-input-46-052d9859514a> in 2 for depth in range (1,2): model DecisionTreeRegressor (max_depth depth) model.fit(X,Y) YP model.predict(X) MSE-mean_squared error(YP,Y) 4 6 MAnaconda31ibsite-packagessklearntreetree.py in fit(self, x, y, sample weight, sample_weight sample_weight, check input-check input, x idx sorted-X_idx sorted) return self 1140 1141 -> 1142 1143 1144 Anaconda31libsite-packagessklearntreetree.py in fit (self, X, y, sample weight, ch check_random_state ( self . random_state) random state if check input: x check array (X, dtype-DTYPE, accept_sparse- “csc”) y check array(y, ensure 2d-False, dtype-None) 114 115 -> 116 117 H Run C Code random_state check_random_state (self . random_state) if check_input: X check_array (X, dtype-DTYPE, accept_sparse=”csc”) y check_array (y, ensure 2d=False, dtype-None) if issparse(X): 114 115 ->116 117 118 Anaconda3libsite-packagessklearnutilsvalidation.py in check array(array, acce rcopy, force_all finite, ensure 2d, allow_nd, ensure min_samples, ensure_min featu 525 try: warnings.simplefilter ('error, ComplexWarning) array np.asarray (array, dtype-dtype, order-order) except Complexwarning: raise ValueError (“Complex data not supportedIn” 526 ->527 528 529 MAnaconda3libsite-packagesnumpycorenumeric.py in asanray(a, dtype, order) 536 537 return array(a, dtype, copy-False, order order) -> 538 539 540 ValueError: could not convert string to float: 'RH

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now