Skip to content

Instantly share code, notes, and snippets.

@marcosatanaka
Created April 28, 2018 22:51
Show Gist options
  • Save marcosatanaka/4daabfd34304455a8dbabe3e723ee6c3 to your computer and use it in GitHub Desktop.
Save marcosatanaka/4daabfd34304455a8dbabe3e723ee6c3 to your computer and use it in GitHub Desktop.
# Cria um regressor (DecisionTree) com o parâmetro 'max_depth
# otimizado para os dados de treinamento
regressor = fit_model(X_train, y_train)
print "O parâmetro 'max_depth' otimizado " \
"para o modelo é {}.\n".format(regressor.get_params()['max_depth'])
client_data = [[5, 17, 15], # Imóvel 1
[4, 32, 22], # Imóvel 2
[8, 3, 12]] # Imóvel 3
# Mostra as estimativas
for i, price in enumerate(regressor.predict(client_data)):
print "Preço estimado para o imóvel {}: ${:,.2f}".format(i+1, price)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment