Comments (3)
This is expected behavior for now. Warning for n_iter_
property might be added.
scikit-learn-intelex/onedal/svm/svm.py
Lines 218 to 221 in bfa470b
from scikit-learn-intelex.
This is expected behavior for now. Warning for
n_iter_
property might be added.scikit-learn-intelex/onedal/svm/svm.py
Lines 218 to 221 in bfa470b
Thanks for the fast response, Alex.
My main issue is that the max_iter parameter seem to have no effect.
Attaching code that shows it:
With patch the code ran for -0.84 seconds and managed to fit the data
`import time
import numpy as np
from sklearnex import patch_sklearn
patch_sklearn()
from sklearn.svm import SVR
patch_svr = SVR(max_iter=2)
np.random.seed(0)
X = np.random.randn(int(1e5), 5)
y = np.mean(X, axis=1)
tic = time.time()
patch_svr.fit(X, y)
print("Time to fit SVR with patch:", time.time() - tic)
score = patch_svr.score(X, y)
print("Score:", score)`
Without the patch the model terminated early, after 0.34 seconds and did not fit the data
`import time
import numpy as np
from sklearnex import patch_sklearn
patch_sklearn()
from sklearn.svm import SVR
patch_svr = SVR(max_iter=2)
np.random.seed(0)
X = np.random.randn(int(1e5), 5)
y = np.mean(X, axis=1)
tic = time.time()
patch_svr.fit(X, y)
print("Time to fit SVR with patch:", time.time() - tic)
score = patch_svr.score(X, y)
print("Score:", score)`
from scikit-learn-intelex.
sklearn and sklearnex use different implementations of SVM, thus, different behavior on same number of iterations it expected.
SVM algorithm stopping is controlled by two parameters: maximum number of iterations (max_iter
) and threshold/tolerance for stopping criterion (tol
). sklearnex SVM might stop in same point while max_iter
s (>= stopping point) are widely different due to trigger of stopping criterion. Because of previously mentioned workaround it's impossible to know how many iterations were performed. If tol
is significantly close to 0 (for example, 1e-32), stopping criterion would be unreachable and SVM training time becomes strictly proportional to max_iter
.
from scikit-learn-intelex.
Related Issues (20)
- PCA on gpu hangs HOT 9
- Cannot install in `Python 3.12` due to `daal4py` not being `py3.12`-ready. HOT 1
- pypy3 support for daal4py/sklearnex HOT 2
- RadiusNeighborsClassifier Support
- No module named 'daal4py._oneapi' HOT 1
- daal4py release notes HOT 1
- Feature Request - usage of Modin with GPU acceleration HOT 1
- SVR not working with intelex path HOT 11
- patch_sklearn() is not working but command line python3 -m sklearnex <file.py> is working HOT 5
- Crash and Cannot load onedal_thread.2.dll HOT 5
- Unable to run patch_sklearn() HOT 2
- INFO HOT 3
- model_selection.learning_curve breaks on some datasets HOT 1
- Logistic regression running with n_jobs=-1 HOT 12
- Patching not implemented for GradientBoost Algorithms HOT 1
- DPC backend error on Windows HOT 1
- How to build scikit-learn-intelex from source HOT 1
- Memory leak DBSCAN HOT 3
- Different results from xgboost when using daal4py converted model HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scikit-learn-intelex.