This commit is contained in:
Szymon Bartanowicz 2024-05-14 23:58:43 +02:00
parent b10d91fa92
commit f39bf64915

View File

@ -11,7 +11,9 @@ import tensorflow as tf
data = pd.read_csv('./data/train.csv') data = pd.read_csv('./data/train.csv')
data = data[['Sex', 'Age', 'BodyweightKg', 'TotalKg']].dropna() data = data[['Sex', 'Age', 'BodyweightKg', 'TotalKg']].dropna()
data['Age'] = pd.to_numeric(data['Age'], errors='coerce')
data['BodyweightKg'] = pd.to_numeric(data['BodyweightKg'], errors='coerce')
data['TotalKg'] = pd.to_numeric(data['TotalKg'], errors='coerce')
features = data[['Sex', 'Age', 'BodyweightKg']] features = data[['Sex', 'Age', 'BodyweightKg']]
target = data['TotalKg'] target = data['TotalKg']
@ -27,7 +29,7 @@ preprocessor = ColumnTransformer(
pipeline = Pipeline(steps=[ pipeline = Pipeline(steps=[
('preprocessor', preprocessor), ('preprocessor', preprocessor),
('model', Sequential([ ('model', Sequential([
Dense(64, activation='relu', input_dim=4), Dense(64, activation='relu', input_dim=5),
Dense(64, activation='relu'), Dense(64, activation='relu'),
Dense(1) Dense(1)
])) ]))