Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Telco_Churn_Feature_Engineering.py #2

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions Telco_Churn_Feature_Engineering.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,6 @@ def cat_summary(dataframe,col_name):

df.groupby("INT_SEC_SERV_GENDER").agg({"Churn": ["mean","count"]})



###############################################
# * 2.3.Processing Encoding and One-Hot Encoding
###############################################
Expand All @@ -437,7 +435,6 @@ def one_hot_encoder(dataframe, categorical_cols, drop_first=True):
ohe_cols = [col for col in df.columns if 30 >= df[col].nunique() > 2]

df = one_hot_encoder(df, ohe_cols)

df.head()

###############################################
Expand All @@ -461,4 +458,4 @@ def one_hot_encoder(dataframe, categorical_cols, drop_first=True):
from sklearn.ensemble import RandomForestClassifier
rf_model = RandomForestClassifier(random_state=46).fit(X_train, y_train)
y_pred = rf_model.predict(X_test)
accuracy_score(y_pred, y_test)
accuracy_score(y_pred, y_test)