Skip to Content
Hands-On Automated Machine Learning
book

Hands-On Automated Machine Learning

by Sibanjan Das, Umit Mert Cakmak
April 2018
Beginner to intermediate content levelBeginner to intermediate
282 pages
6h 52m
English
Packt Publishing
Content preview from Hands-On Automated Machine Learning

Adding simple components together to improve the pipeline

Let's make some adjustments to the fit_predict method to include a decomposer in your pipeline, so that you can visualize high-dimensional data if necessary:

def fit_predict(self, X, y=None, scaler=True, decomposer={'name': PCA, 'args':[], 'kwargs': {'n_components': 2}}):    """    fit_predict will train given estimator(s) and predict cluster membership for each sample    """    shape = X.shape    df_type = isinstance(X, pd.core.frame.DataFrame)    if df_type:        column_names = X.columns        index = X.index    if scaler == True:        from sklearn.preprocessing import StandardScaler        scaler = StandardScaler()        X = scaler.fit_transform(X)        if df_type:            X = pd.DataFrame(X, index=index, columns=column_names)    if decomposer ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Automated Machine Learning

Automated Machine Learning

Adnan Masood
R: Unleash Machine Learning Techniques

R: Unleash Machine Learning Techniques

Raghav Bali, Dipanjan Sarkar, Brett Lantz, Cory Lesmeister

Publisher Resources

ISBN: 9781788629898Supplemental Content