Skip to content

Instantly share code, notes, and snippets.

depth = 10
seed_range = range(0, 3000,288)
acc_vs_seed_result_rf = {"seed": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
for seed in seed_range:
depth = 10
seed_range = range(0, 3000,288)
acc_vs_seed_result_rf = {"seed": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
for seed in seed_range:
#Random Forest
seed = 1
depth_range = range(1, 30,1)
acc_vs_depth_result_rf = {"depth": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
#Random Forest
seed = 1
depth_range = range(1, 30,1)
acc_vs_depth_result_rf = {"depth": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
acc_vs_seed_result = {"seed": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
depth = 10
seed_range = range(0, 3000,288)
for seed in seed_range:
depth = 10
seed_range = range(0, 3000,288)
acc_vs_seed_result = {"seed": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
for seed in seed_range:
acc_vs_depth_result = {"depth": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
seed = 1
depth_range = range(1, 30,1)
for depth in depth_range:
seed = 1
depth_range = range(1, 30,1)
acc_vs_depth_result = {"depth": [],\
"train_acc": [],
"valid_acc": [],
"top_feature": [],
"second_feature": [],
"third_feature": []}
for depth in depth_range:
## Code courtsey: Manav Sehgal (https://www.kaggle.com/startupsci)
## Link to Original Code: https://www.kaggle.com/startupsci/titanic-data-science-solutions
# data analysis and wrangling
import pandas as pd
import numpy as np
import random as rnd
def titanic(train, test):
train_df = pd.read_csv(train)
## Code Courtsey: juliencs (https://www.kaggle.com/juliencs)
## Link to Original Script: https://www.kaggle.com/juliencs/a-study-on-regression-applied-to-the-ames-dataset
# Imports
import pandas as pd
import numpy as np
from scipy.stats import skew
def housing(train):
# Get data