from sklearn.preprocessing import RobustScaler
from sklearn.datasets import make_blobs
from sklearn.svm import SVC
from sklearn.pipeline import make_pipeline
from sklearn.model_selection import train_test_split
# Generate a synthetic dataset
X, y = make_blobs(n_samples=100, centers=2, random_state=42, cluster_std=5)
# Add some outliers
X[0, :] = [50, 50]
X[1, :] = [-50, -50]
# Split the data into training and test sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.25, random_state=42)
# Create a pipeline with RobustScaler and SVM
model = make_pipeline(RobustScaler(), SVC())
# Train the model on the training data
model.fit(X_train, y_train)
# Evaluate the model on the test data
accuracy = model.score(X_test, y_test)
print("Accuracy: {:.2f}%".format(accuracy * 100))