online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
# Import necessary libraries from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.neural_network import MLPClassifier from sklearn.preprocessing import StandardScaler from sklearn.metrics import (accuracy_score, classification_report, confusion_matrix, ConfusionMatrixDisplay) import matplotlib.pyplot as plt # Load the Iris dataset data = load_iris() X = data.data # Features y = data.target # Target labels feature_names = data.feature_names class_names = data.target_names # Split the data into training and testing sets (80% train, 20% test) X_train, X_test, y_train, y_test = train_test_split( X, y, test_size=0.2, random_state=42, stratify=y ) # Standardize features by removing the mean and scaling to unit variance scaler = StandardScaler() X_train = scaler.fit_transform(X_train) X_test = scaler.transform(X_test) # Initialize the MLP classifier mlp = MLPClassifier( hidden_layer_sizes=(100, 50), # Two hidden layers with 100 and 50 neurons activation='relu', # Rectified Linear Unit activation solver='adam', # Optimization algorithm alpha=0.0001, # L2 penalty (regularization term) parameter batch_size='auto', # Size of minibatches learning_rate='constant', # Learning rate schedule learning_rate_init=0.001, # Initial learning rate max_iter=500, # Maximum number of iterations random_state=42, # Random seed early_stopping=True, # Use early stopping to terminate training when validation score stops improving validation_fraction=0.1 # Fraction of training data to set aside as validation set ) # Train the model mlp.fit(X_train, y_train) # Make predictions y_pred = mlp.predict(X_test) y_pred_prob = mlp.predict_proba(X_test) # Evaluate the model print(f"Training set score: {mlp.score(X_train, y_train):.3f}") print(f"Test set score: {mlp.score(X_test, y_test):.3f}\n") print("Classification Report:") print(classification_report(y_test, y_pred, target_names=class_names)) # Plot confusion matrix

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue