데이터는 기기 설정값을 녹화한 시계열로 보입니다. ID 순으로 plot 했을 때 깔끔한 플롯을 보입니다.
반도체 대회니 y는 산출량으로 보고, x 값은 센서나 재료 등의 값으로 보면 될 것 같습니다.
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Load the data
df = pd.read_csv('train.csv')
# Create histograms for each variable
fig, axes = plt.subplots(4, 3, figsize=(20, 20))
axes = axes.ravel()
for i, col in enumerate(df.columns[1:]): # Skip the ID column
sns.histplot(df[col], ax=axes[i], kde=True)
axes[i].set_title(f'Distribution of {col}')
plt.tight_layout()
plt.show()
# Create box plots for each variable
fig, axes = plt.subplots(4, 3, figsize=(20, 20))
axes = axes.ravel()
for i, col in enumerate(df.columns[1:]): # Skip the ID column
sns.boxplot(y=df[col], ax=axes[i])
axes[i].set_title(f'Box plot of {col}')
plt.tight_layout()
plt.show()
import pandas as pd
import matplotlib.pyplot as plt
# Load the data
df = pd.read_csv('train.csv')
# Determine the number of columns and rows for the subplot grid
num_cols = 4
num_rows = 3
# Create the subplots
fig, axes = plt.subplots(nrows=num_rows, ncols=num_cols, figsize=(20, 15))
# Flatten the axes array for easy iteration
axes = axes.flatten()
# Plot each column as a time series
for i, column in enumerate(df.columns[1:]):
if i < len(axes):
axes[i].plot(df.index, df[column], label=column)
axes[i].set_title(column)
# axes[i].set_xlabel('Date')
axes[i].set_ylabel(column)
axes[i].legend()
# Hide any unused subplots
for j in range(i + 1, len(axes)):
fig.delaxes(axes[j])
plt.tight_layout()
plt.show()
# Check for correlations
correlation_matrix = df.iloc[:, 1:].corr()
plt.figure(figsize=(12, 10))
sns.heatmap(correlation_matrix, annot=True, cmap='crest')
plt.title('Feature Correlation Matrix')
plt.show()