-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
7,746 additions
and
463 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"form_fields": [ | ||
{"name": "gender", "label": "Gender", "type": "dropdown", "options": ["Male", "Female"], "default": "Female"}, | ||
{"name": "SeniorCitizen", "label": "Senior Citizen", "type": "number", "default": 0}, | ||
{"name": "Partner", "label": "Partner", "type": "dropdown", "options": ["Yes", "No"], "default": "No"}, | ||
{"name": "Dependents", "label": "Dependents", "type": "dropdown", "options": ["Yes", "No"], "default": "No"}, | ||
{"name": "tenure", "label": "Tenure (Months)", "type": "number", "default": 1}, | ||
{"name": "PhoneService", "label": "Phone Service", "type": "dropdown", "options": ["Yes", "No"], "default": "Yes"}, | ||
{"name": "MultipleLines", "label": "Multiple Lines", "type": "dropdown", "options": ["Yes", "No", "No phone service"], "default": "No"}, | ||
{"name": "InternetService", "label": "Internet Service", "type": "dropdown", "options": ["DSL", "Fiber optic", "No"], "default": "No"}, | ||
{"name": "OnlineSecurity", "label": "Online Security", "type": "dropdown", "options": ["Yes", "No", "No internet service"], "default": "No"}, | ||
{"name": "OnlineBackup", "label": "Online Backup", "type": "dropdown", "options": ["Yes", "No", "No internet service"], "default": "No"}, | ||
{"name": "DeviceProtection", "label": "Device Protection", "type": "dropdown", "options": ["Yes", "No", "No internet service"], "default": "No"}, | ||
{"name": "TechSupport", "label": "Tech Support", "type": "dropdown", "options": ["Yes", "No", "No internet service"], "default": "No"}, | ||
{"name": "StreamingTV", "label": "Streaming TV", "type": "dropdown", "options": ["Yes", "No", "No internet service"], "default": "No"}, | ||
{"name": "StreamingMovies", "label": "Streaming Movies", "type": "dropdown", "options": ["Yes", "No", "No internet service"], "default": "No"}, | ||
{"name": "Contract", "label": "Contract Type", "type": "dropdown", "options": ["Month-to-month", "One year", "Two year"], "default": "Month-to-month"}, | ||
{"name": "PaperlessBilling", "label": "Paperless Billing", "type": "dropdown", "options": ["Yes", "No"], "default": "Yes"}, | ||
{"name": "PaymentMethod", "label": "Payment Method", "type": "dropdown", "options": ["Electronic check", "Mailed check", "Bank transfer (automatic)", "Credit card (automatic)"], "default": "Electronic check"}, | ||
{"name": "MonthlyCharges", "label": "Monthly Charges", "type": "number", "default": 50.0}, | ||
{"name": "TotalCharges", "label": "Total Charges", "type": "number", "default": 100.0} | ||
], | ||
"model_input_mapping": { | ||
"gender": "gender", | ||
"SeniorCitizen": "SeniorCitizen", | ||
"Partner": "Partner", | ||
"Dependents": "Dependents", | ||
"tenure": "tenure", | ||
"PhoneService": "PhoneService", | ||
"MultipleLines": "MultipleLines", | ||
"InternetService": "InternetService", | ||
"OnlineSecurity": "OnlineSecurity", | ||
"OnlineBackup": "OnlineBackup", | ||
"DeviceProtection": "DeviceProtection", | ||
"TechSupport": "TechSupport", | ||
"StreamingTV": "StreamingTV", | ||
"StreamingMovies": "StreamingMovies", | ||
"Contract": "Contract", | ||
"PaperlessBilling": "PaperlessBilling", | ||
"PaymentMethod": "PaymentMethod", | ||
"MonthlyCharges": "MonthlyCharges", | ||
"TotalCharges": "TotalCharges" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pandas as pd | ||
from sklearn.model_selection import train_test_split | ||
|
||
# Load your dataset | ||
try: | ||
df = pd.read_csv('dataset.csv') | ||
except FileNotFoundError: | ||
print("Error: The file 'dataset.csv' was not found. Please check the file path.") | ||
exit() | ||
|
||
# Split the data into features (X) and target (y) | ||
X = df.drop(columns=['Churn']) # Replace 'Churn' with the target column name if different | ||
y = df['Churn'] | ||
|
||
# Split data into training and test sets | ||
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) | ||
|
||
# Combine X and y back together for each set to save as CSV | ||
train_data = pd.concat([X_train, y_train], axis=1) | ||
test_data = pd.concat([X_test, y_test], axis=1) | ||
|
||
# Save the train and test sets as separate CSV files | ||
train_data.to_csv('train_data.csv', index=False) | ||
test_data.to_csv('test_data.csv', index=False) | ||
|
||
print("Train and test datasets saved as 'train_data.csv' and 'test_data.csv'") |
Oops, something went wrong.