Skip to content

Instantly share code, notes, and snippets.

@marcosatanaka
Last active April 24, 2018 19:36
Show Gist options
  • Save marcosatanaka/09a9ded65e38119d5aeade55916b7a97 to your computer and use it in GitHub Desktop.
Save marcosatanaka/09a9ded65e38119d5aeade55916b7a97 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from sklearn.cross_validation import ShuffleSplit
from sklearn.cross_validation import train_test_split
from sklearn.metrics import r2_score
from sklearn.metrics import make_scorer
from sklearn.grid_search import GridSearchCV
from sklearn.tree import DecisionTreeRegressor
# Lendo conjunto de dados de imóveis
data = pd.read_csv('housing.csv')
prices = data['MEDV']
features = data.drop('MEDV', axis = 1)
print "\n\nO conjunto de dados de imóveis tem {} pontos " \
"com {} variáveis em cada.\n\n".format(*data.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment