fuzzy-rules-generator/dataset.ipynb
2025-03-05 17:33:16 +04:00

252 KiB

In [2]:
import pandas as pd

density_train = pd.read_csv("data/density_train.csv", sep=";", decimal=",")
density_test = pd.read_csv("data/density_test.csv", sep=";", decimal=",")
d_data = pd.concat([density_train, density_test])
d_data.info()
<class 'pandas.core.frame.DataFrame'>
Index: 55 entries, 0 to 16
Data columns (total 4 columns):
 #   Column   Non-Null Count  Dtype  
---  ------   --------------  -----  
 0   T        55 non-null     int64  
 1   Al2O3    55 non-null     float64
 2   TiO2     55 non-null     float64
 3   Density  55 non-null     float64
dtypes: float64(3), int64(1)
memory usage: 2.1 KB
In [3]:
import matplotlib.pyplot as plt

d_data.hist(bins=30, figsize=(10, 10))
plt.show()
In [4]:
import seaborn as sns

sns.catplot(
    y="value",
    data=d_data.melt(value_vars=d_data.columns), # type: ignore
    col="variable",
    kind="box",
    col_wrap=2,
    sharex=False,
    sharey=False,
)
Out[4]:
<seaborn.axisgrid.FacetGrid at 0x123f26c30>
In [18]:
sns.heatmap(d_data.corr(), annot=True, fmt=".1%")
Out[18]:
<Axes: >
In [6]:
viscosity_train = pd.read_csv("data/viscosity_train.csv", sep=";", decimal=",")
viscosity_test = pd.read_csv("data/viscosity_test.csv", sep=";", decimal=",")

v_data = pd.concat([viscosity_train, viscosity_test])
v_data.info()
<class 'pandas.core.frame.DataFrame'>
Index: 55 entries, 0 to 16
Data columns (total 4 columns):
 #   Column     Non-Null Count  Dtype  
---  ------     --------------  -----  
 0   T          55 non-null     int64  
 1   Al2O3      55 non-null     float64
 2   TiO2       55 non-null     float64
 3   Viscosity  55 non-null     float64
dtypes: float64(3), int64(1)
memory usage: 2.1 KB
In [7]:
v_data.hist(bins=30, figsize=(10, 10))
plt.show()
In [8]:
sns.catplot(
    y="value",
    data=v_data.melt(value_vars=v_data.columns),  # type: ignore
    col="variable",
    kind="box",
    col_wrap=2,
    sharex=False,
    sharey=False,
)
Out[8]:
<seaborn.axisgrid.FacetGrid at 0x122dc5850>
In [19]:
sns.heatmap(v_data.corr(), annot=True, fmt=".1%")
Out[19]:
<Axes: >