Support Vector Machine (SVM)
Trình mô phỏng trực quan & Thực thi code Python giả lập.
Python Lab
Thực thi mô hình dựa trên trực quan hóa.
main.py
import numpy as np
from sklearn import svm
# Lấy dữ liệu từ canvas (đã được chuẩn hóa)
X = np.array([])
y = np.array([])
# Khởi tạo mô hình SVC với tham số C từ thanh trượt
C_param = 1.0
model = svm.SVC(kernel='linear', C=C_param)
# Huấn luyện mô hình
model.fit(X, y)
# Kết quả đầu ra
print(f"Số lượng Support Vectors: {len(model.support_vectors_)}")
print(f"Trọng số w: {model.coef_}")
print(f"Sai số b: {model.intercept_}")
// Kết quả (Output) sẽ xuất hiện ở đây khi nhấn Run...
chat_bubble Bình luận (0)