“como usar árvore aleatória em python” Respostas de código

como usar árvore aleatória em python

from sklearn.ensemble import RandomForestRegressor

regressor = RandomForestRegressor(n_estimators=20, random_state=0)
regressor.fit(X_train, y_train)
y_pred = regressor.predict(X_test)
Wide-eyed Whale

como usar árvore aleatória em python

from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
Wide-eyed Whale

como usar árvore aleatória em python

from sklearn import metrics

print('Mean Absolute Error:', metrics.mean_absolute_error(y_test, y_pred))
print('Mean Squared Error:', metrics.mean_squared_error(y_test, y_pred))
print('Root Mean Squared Error:', np.sqrt(metrics.mean_squared_error(y_test, y_pred)))
Wide-eyed Whale

Respostas semelhantes a “como usar árvore aleatória em python”

Perguntas semelhantes a “como usar árvore aleatória em python”

Mais respostas relacionadas para “como usar árvore aleatória em python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código