This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
housing = pd.read_csv('http://bit.ly/kagglehousingtrain') | |
cols = ['GrLivArea', 'GarageArea'] | |
X = housing[cols].values | |
from sklearn.preprocessing import StandardScaler | |
from sklearn.model_selection import KFold, cross_val_score | |
from sklearn.tree import DecisionTreeRegressor | |
ss = StandardScaler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from sklearn.base import BaseEstimator | |
class BasicTransformer(BaseEstimator): | |
def __init__(self, cat_threshold=None, num_strategy='median', return_df=False): | |
# store parameters as public attributes | |
self.cat_threshold = cat_threshold |