Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Correlation map of the impact of air quality on mortality rates
import pandas as pd
from sklearn.linear_model import LinearRegression
features = ['T2M']
train = pd.read_csv('./data/train.csv')
test = pd.read_csv('./data/test.csv')
train = train.dropna(axis=0, how = 'any')
print(train.describe())
X_train = train[features]
y = train['mortality_rate'].copy()
X_test = test[features].copy()
lr = LinearRegression()
lr.fit(X_train, y)
predictions = test[['Id']].copy()
predictions['mortality_rate'] = lr.predict(X_test)
predictions.to_csv('linear_regression.csv', index = False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment