Skip to content

Instantly share code, notes, and snippets.

@ngopal
ngopal / stacking_example.py
Created February 24, 2018 22:20 — forked from geffy/stacking_example.py
Stacking example
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 23:16:44 2017
@author: Marios Michailidis
This is an example that performs stacking to improve mean squared error
This examples uses 2 bases learners (a linear regression and a random forest)
and linear regression (again) as a meta learner to achieve the best score.
The initial train data are split in 2 halves to commence the stacking.