Update 'train.py'

This commit is contained in:
Wojciech Mikołajski 2023-06-17 20:24:05 +02:00
parent d67aec6747
commit 11768a9460

View File

@ -1,15 +1,14 @@
import pandas as pd import pandas as pd
import tensorflow as tf import tensorflow as tf
from sklearn.preprocessing import StandardScaler, OneHotEncoder from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
water = pd.read_csv('waterQuality1.csv') water = pd.read_csv('waterQuality1.csv')
water = water[water['is_safe'].apply(lambda x: str(x).isdigit())] water = water[water['is_safe'].apply(lambda x: str(x).isdigit())]
water['is_safe'].value_counts() water['is_safe'].value_counts()
from sklearn.model_selection import train_test_split
from sklearn import preprocessing
water_min_max = preprocessing.MinMaxScaler() water_min_max = preprocessing.MinMaxScaler()
water_min_max = water_min_max.fit_transform(water) water_min_max = water_min_max.fit_transform(water)
water_min_max = pd.DataFrame(water_min_max, columns=water.columns) water_min_max = pd.DataFrame(water_min_max, columns=water.columns)