Problem - Link
Data Analysis (Approach)
- Load data in SQL Tables
- Analyze each column, Continous or Discrete variables
- Outliers, missing data, summary of each Data Column
- Manage Class Imbalances
- Convert the dataset into numeric columns
- Ignore any non-critical columns
- Identify Data Correlations if it exists (Pending task)
1. To eliminate class imbalance used smote technique
2. Used XGBoost to train and predict
3. Python 2.7 used. Two files one for Data cleanup, second for prediction
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
#Approach #1 | |
from sklearn import svm | |
from imblearn.over_sampling import SMOTE | |
#SMOTE and SVM | |
y1 = df['loan_status'] | |
x1 = df[features] | |
sm = SMOTE(kind='svm') | |
x, y = sm.fit_sample(x1, y1) | |
model = svm.SVC(decision_function_shape='ovo') | |
model.fit(x,y) | |
predictions = model.predict(x_test) | |
#Approach #2 | |
#PCA & SVM | |
from sklearn.decomposition import PCA | |
from sklearn.svm import SVC | |
y1 = df['loan_status'] | |
x1 = df[features] | |
pca = PCA(n_components=10) | |
x1_train_pca = pca.fit_transform(x1) | |
clf=SVC(probability=True) | |
clf.fit(x1_train_pca,y1) | |
pca = PCA(n_components=10) | |
x_test_pca = pca.fit_transform(x_test) | |
predictions = clf.predict_proba(x_test_pca) | |
No comments:
Post a Comment