does the following code follow these requirements. A.	Developing ANN using ML Libraries
3.1	Retrieve the datasets you prepared in Part 1 above.
3.2	Construct, train and test a multilayer feedforward neural network with the same datasets prepared in Part 1 using a selected machine learning library, like scikitlearn or Keras.  Detail the hyperparameters and training rules/algorithms you adopted in the report. Compare the performance of this model with the neural network classifier you trained in Part 1 above. 
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.compose import ColumnTransformer
from sklearn.pipeline import Pipeline
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from sklearn.metrics import roc_curve, roc_auc_score
from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score

# Load the dataset
data = pd.read_csv('garments_worker_productivity.csv')
print("The first few rows of the dataset:")
print(data.head())
print("\nColumns in the dataframe:")
print(data.columns)

# Ensure the 'actual_productivity' column is present
if 'actual_productivity' not in data.columns:
    raise ValueError("The column 'actual_productivity' does not exist in the dataframe. Check the column name.")

# Convert 'date' to datetime and extract components
if 'date' in data.columns:
    data['date'] = pd.to_datetime(data['date'])
    data['year'] = data['date'].dt.year
    data['month'] = data['date'].dt.month
    data['day'] = data['date'].dt.day
    data.drop('date', axis=1, inplace=True)

# Encode categorical variables
for cat_column in ['quarter', 'department']:
    if cat_column in data.columns:
        data = pd.get_dummies(data, columns=[cat_column], drop_first=True)

# Fill missing values
data.fillna(data.mean(), inplace=True)

# Define features
categorical_features = [col for col in data.columns if col.startswith('quarter_') or col.startswith('department_')]
numerical_features = [col for col in data.columns if col not in categorical_features and col != 'actual_productivity']

# Preprocessing
numerical_transformer = Pipeline(steps=[('scaler', StandardScaler())])
categorical_transformer = Pipeline(steps=[('onehot', OneHotEncoder(handle_unknown='ignore'))])

preprocessor = ColumnTransformer(
    transformers=[
        ('num', numerical_transformer, numerical_features),
        ('cat', categorical_transformer, categorical_features)
    ])

# Define the target as a binary class
data['productivity_class'] = (data['actual_productivity'] >= 0.75).astype(int)
X = data.drop(['actual_productivity', 'productivity_class'], axis=1)
y = data['productivity_class']

# Split and transform the data
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
X_train = preprocessor.fit_transform(X_train)
X_test = preprocessor.transform(X_test)

# Neural network model
model = Sequential([
    Dense(128, activation='relu', input_shape=(X_train.shape[1],)),
    Dense(64, activation='relu'),
    Dense(32, activation='relu'),
    Dense(1, activation='sigmoid')
])
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
history = model.fit(X_train, y_train, epochs=1000, validation_split=0.2)

# Predict and evaluate
predictions_probs = model.predict(X_test)
predictions = (predictions_probs > 0.5).astype(int)
accuracy = accuracy_score(y_test, predictions)
precision = precision_score(y_test, predictions)
recall = recall_score(y_test, predictions)
f1 = f1_score(y_test, predictions)
roc_auc = roc_auc_score(y_test, predictions_probs)  # Correct usage

# ROC Curve
fpr, tpr, thresholds = roc_curve(y_test, predictions_probs)
plt.figure()
plt.plot(fpr, tpr, color='darkorange', lw=2, label=f'ROC curve (area = {roc_auc:.2f})')
plt.plot([0, 1], [0, 1], color='navy', lw=2, linestyle='-')
plt.xlim([0.0, 1.0])
plt.ylim([0.0, 1.05])
plt.xlabel('False Positive Rate')
plt.ylabel('True Positive Rate')
plt.title('Receiver Operating Characteristic (ROC)')
plt.legend(loc="lower right")
plt.show()

# Print evaluation metrics
print(f'Accuracy: {accuracy * 100:.2f}%, Precision: {precision * 100:.2f}%, Recall: {recall * 100:.2f}%, F1 Score: {f1:.2f}')