svr_model
Builtin index · Statistics & ML
result = svr_model(X, y)
Input: X, y · Output: result
What it is
Support-vector regression on an N-row, D-column X and a length-N numeric target y.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = svr_model(X, y) | X vectornot documented yety vectornot documented yet | result Record | Returns a fitted model Record with .predict/.score, .score giving R². |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
km = kmedians_model(G, 3, seed = 5)
kd = kmedoids_model(G, 3, seed = 5)
gm = gmm_model(G, 3, seed = 5)
print("kmedians label for row 0: {km.predict(G)[0]}")
print("kmedoids label for row 0: {kd.predict(G)[0]}")
print("gmm log-likelihood: {round(gm.log_likelihood, 1)}")
gb = gradient_boosting_model(X, y, 20, learning_rate = 0.1, max_depth = 3)
print("gradient boosting r2: {round(gb.score(X, y), 3)}")
sv = svm_model(Xc, yc, kernel = "linear", C = 1.0)
lg = logistic_model(Xc, yc)
print("svm accuracy: {round(sv.score(Xc, yc), 3)}")
print("logistic accuracy: {round(lg.score(Xc, yc), 3)}")
svr = svr_model(X, y)
print("svr r2: {round(svr.score(X, y), 3)}")
output
kmedians label for row 0: 1 kmedoids label for row 0: 1 gmm log-likelihood: [-448.7, -448.7, -448.7, -448.7] gradient boosting r2: 0.953 svm accuracy: 0.995 logistic accuracy: 0.995 svr r2: 0.596
from statistics-ml
How it works
svr_model(X, y, [C=], [epsilon=], [learning_rate=], [n_iter=]) — see svr_fit_model's own doc comment for the algorithm (linear-kernel, primal subgradient descent) and why it's scoped that way rather than a kernelized dual SMO solver.
From the note above this builtin in the interpreter, where the reasoning was written down as it was built.