<jupyter_start><jupyter_text><jupyter_code>import seaborn as sns
df = sns.load_dataset('titanic')
df<jupyter_output><empty_output><jupyter_text>pclass , sex ,sibsp , parch , embarked , class , who , adult_male , embark_town , alive , alone<jupyter_code>X = df[[ 'fare','pclass']]
Y = df[[ 'survived']]
X.shape , Y.shape
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaler.fit(X) # 값은 가지고 있지 않고 규칙만 가지고 있게 됨
# 실제 데이터 넣어서 값을 확인하면됨
X = scaler.transform(X)
X , X.shape
# 일부 데이터 확인 하기 위해 split 한다
from sklearn.model_selection import train_test_split
x_train, x_test, y_train , y_test = train_test_split(X, Y)
# 선형회귀에 실제 대입
from sklearn.linear_model import LogisticRegression
logR = LogisticRegression()
logR.fit(x_train , y_train)
logR.score(x_train,y_train)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11193111931119311, 'fraction_numerical': 0.0, 'mean_word_length': 6.267857142857143, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '255126', 'license': 'Apache-2.0', 'n_tokens_mistral': 371, 'n_tokens_neox': 394, 'n_words': 77, 'path': 'titanic_without_onehot_LogistricRegression.ipynb', 'repo_name': 'Ethan-Jeong/test_machinelearning', 'size': '813'}