<jupyter_start><jupyter_text>set up original  Applied Modeling SC practice notebook Part 1: PreprocessingYou may choose which features you want to use, and whether/how you will preprocess them. If you use categorical features, you may use any tools and techniques for encoding._To earn a score of 3 for this part, find and explain leakage. The dataset has a feature that will give you an ROC AUC score > 0.90 if you process and use the feature. Find the leakage and explain why the feature shouldn't be used._ Part 2: Modeling**Fit a model** with the train set. (You may use scikit-learn, xgboost, or any other library.) Use cross-validation or do a three-way split (train/validate/test) and **estimate your ROC AUC** validation score.Use your model to **predict probabilities** for the test set. **Get an ROC AUC test score >= 0.60.**_To earn a score of 3 for this part, get an ROC AUC test score >= 0.70 (without using the feature with leakage)._ Part 3: VisualizationMake visualizations for model interpretation. (You may use any libraries.) Choose two of these types:- Permutation Importances- Partial Dependence Plot, 1 feature isolation- Partial Dependence Plot, 2 features interaction- Shapley Values_To earn a score of 3 for this part, make all four of these visualization types._<jupyter_code>import seaborn as sns
from sklearn.model_selection import train_test_split

df = sns.load_dataset('titanic')
train, test = train_test_split(df, train_size=0.80, test_size=0.20, random_state=42)
assert train.shape == (712, 15)
assert test.shape == (179, 15)
ship = df.drop(columns=['alive', 'survived'])
tar = df[['survived']]
ship.head()

### Part 1: Preprocessing

#You may choose which features you want to use, and whether/how you will preprocess them. 

 #The dataset has a feature that will give you an ROC AUC score > 0.90 
tar.head()<jupyter_output><empty_output><jupyter_text>Answer  Part 2: Modeling**Fit a model** with the train set. -scikit-learn-xgboostUse cross-validation or do a three-way split (train/validate/test)**estimate your ROC AUC** validation score.Use your model to **predict probabilities** for the test set.**Get an ROC AUC test score >= 0.60.**<jupyter_code>from sklearn.model_selection import train_test_split

X_train, X_val, y_train, y_val = train_test_split(
   ship, tar, train_size=0.75, test_size=0.25, random_state=42
)
#train_test_split()
X_train.shape, X_val.shape, y_train.shape, y_val.shape
import numpy as np
from sklearn.metrics import accuracy_score
majority_class = y_train.mode()[0]
#y_pred = np.full_like(y_val, fill_value=majority_class)
#accuracy_score(y_val, y_pred)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08761329305135952, 'fraction_numerical': 0.019637462235649546, 'mean_word_length': 5.26241134751773, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '177607', 'license': 'MIT', 'n_tokens_mistral': 850, 'n_tokens_neox': 782, 'n_words': 333, 'path': 'Sprint7_Practice_challengeipynb.ipynb', 'repo_name': 'Zebfred/DS-Unit-2-Applied-Modeling', 'size': '2648'}