text_html_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import seaborn as sns

data = pd.read_csv('../input/machine-predictive-maintenance-classification/predictive_maintenance.csv', sep=',')

data['Overstrain [minNm]'] = data['Torque [Nm]'] * data['Tool wear [min]']
data['Required Power [W]'] = data['Torque [Nm]'] * data['Rotational speed [rpm]']
data['Heat Dissipation [K]'] = data['Process temperature [K]'] - data['Air temperature [K]']
cols = data.columns.tolist()
cols = cols[-3:] + cols[:-3]
data = data[cols]

data['Type'].value_counts(ascending=True)

corr = data.drop('UDI', axis=1).corr()
plt.figure(figsize=(12, 10))
cmap = sns.diverging_palette(230, 20, as_cmap=True)
mask = np.triu(np.ones_like(corr, dtype=bool))
sns.heatmap(corr, annot=True, cmap=cmap, mask=mask, center=0)