Machine learning studioSVM (libsvm)Browser-local
SVM — Support Vector Machines (Explained)
A proper interactive SVM tool: upload CSVs, tune kernels, and see the decision boundary update.
Data
Load data + map columns
0 rows loadedBrowser-local
Column mapping
Feature columns (X)
Data preview
Showing up to 8 columns and the first 8 rows.
SVM model
Tune parameters + see boundary
Decision boundary
Support vectors are highlighted with an amber ring. Background shading shows predicted class regions.
Results
Train a model to see metrics.
Generated code (Python)
scikit-learn equivalent
# SVM Studio — Python export
# pip install pandas scikit-learn
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.pipeline import Pipeline
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
CSV_PATH = "your_dataset.csv"
FEATURE_COLS = [
"x1",
"x2"
]
TARGET_COL = "label"
ENCODING = "numeric"
STANDARDIZE = True
TEST_SIZE = 0.25
RANDOM_STATE = 42
df = pd.read_csv(CSV_PATH)
X = df[FEATURE_COLS]
y = df[TARGET_COL]
numeric_cols = X.select_dtypes(include=["number"]).columns.tolist()
categorical_cols = [c for c in X.columns if c not in numeric_cols]
cat = OneHotEncoder(handle_unknown="ignore") if ENCODING == "onehot" else "passthrough"
num_steps = []
if STANDARDIZE:
num_steps.append(("scaler", StandardScaler()))
num = Pipeline(steps=num_steps) if num_steps else "passthrough"
preprocess = ColumnTransformer([("num", num, numeric_cols), ("cat", cat, categorical_cols)], remainder="drop")
clf = SVC(kernel="rbf", C=1, gamma=0.5, degree=3, coef0=0)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=TEST_SIZE, random_state=RANDOM_STATE, stratify=y)
pipe = Pipeline([("preprocess", preprocess), ("model", clf)])
pipe.fit(X_train, y_train)
pred = pipe.predict(X_test)
print("Accuracy:", accuracy_score(y_test, pred))
print("Confusion matrix:\n", confusion_matrix(y_test, pred))
print("\nClassification report:\n", classification_report(y_test, pred))