Created
November 2, 2018 09:55
-
-
Save nithyadurai87/e0cca6ec864405a032888244122a90d8 to your computer and use it in GitHub Desktop.
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
import pandas as pd | |
import matplotlib.pyplot as plt | |
import numpy | |
from sklearn.linear_model import LinearRegression | |
from sklearn.model_selection import train_test_split,cross_val_score | |
from sklearn.metrics import mean_squared_error | |
from math import sqrt | |
from sklearn.feature_selection import RFE | |
from sklearn.datasets import make_friedman1 | |
df = pd.read_csv('./training_data.csv') | |
print (df.shape,df.columns) | |
# Dropping columns which has correlation with target less than threshold | |
target = "A" | |
correlations = df.corr()[target].abs() | |
correlations = correlations.round(2) | |
correlations.to_csv('./PV_MVDV_correlation.csv',index=False) | |
df=df.drop(correlations[correlations<0.06].index, axis=1) | |
print (df.shape,df.columns) | |
df.to_csv('./training.csv',index=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment