Replies: 1 comment
-
Can you specify data and SVC parameters, please? Without them, it is hard to say is prediction slow-down expected. I run this example and prediction performance with sklearnex is better than stock: import logging
logging.getLogger().setLevel(logging.INFO)
from timeit import default_timer as timer
from sklearn.datasets import make_classification
from sklearn.svm import SVC as SVCStock
from sklearnex.svm import SVC as SVCOptimized
random_state = 42
data_params = {
'n_samples': 5000,
'n_features': 1024,
'n_informative': 512,
'n_classes': 5,
'random_state': random_state
}
x, y = make_classification(**data_params)
svm_params = {
'kernel': 'poly'
}
n_runs = 10
svc = SVCStock(**svm_params).fit(x, y)
t0 = timer()
for i in range(n_runs):
svc.predict(x)
t1 = timer()
svc = SVCOptimized(**svm_params).fit(x, y)
t2 = timer()
for i in range(n_runs):
svc.predict(x)
t3 = timer()
print(f'Stock time[s]: {(t1 - t0) / n_runs}')
print(f'Optim time[s]: {(t3 - t2) / n_runs}') |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, im exploring your cool package and when using SVC with polynomial kernel i do see improvement during fitting phase.
But when benchmarking prediction time I see slow-down in results. Is this behavior expected ?
Thank you !
Beta Was this translation helpful? Give feedback.
All reactions