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
## 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 |
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
## 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) |
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
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: |
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
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: |
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
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: |
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
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: |
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
#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": []} |
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
#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": []} |
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
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: |
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
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: |