Open beevabeeva opened 4 years ago
Update: This might be due to really bad hyperparameters being passed to ThunderSVM from the AutoML framework. A comment in the ATM source code suggests this:
Notes:
- Support vector machines (svm) can take a long time to train. It's not an
error, it's just part of what happens when the method happens to explore
a crappy set of parameters on a powerful algo like this.
Having said that, this might not be the only issue causing the slow computation.
Thanks. We will look into the issue.
Some quick hints: hyper-parameters can affect convergence; data normalization also affects convergence. You may try to help us find out.
Any update on this? I would also be curious to learn if there are performance bottlenecks...
ThunderSVM almost always works much better than the existing ones. The known poor performance of ThunderSVM is the convergence issue in some extreme cases (e.g., the values of each dimension vary from 0 to 10,000), and some extreme hyper-parameters can also affect the efficiency of SVMs (not only ThunderSVM).
I also have the same problem. Using the tabular playground of kaggle of feb 2021. `data_train = pd.read_csv('train.csv',sep=",").drop(columns=['id']) data_test = pd.read_csv('test.csv',sep=",").drop(columns=['id']) y = data_train['target'] X = data_train.drop(columns=['target'])
cats_name = [c for c in X.columns if 'cat' in c] cont_name = [c for c in X.columns if 'cont' in c] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42) `
`column_trans = ColumnTransformer( [('cats',OneHotEncoder(),cats_name), ('conts',StandardScaler(),cont_name)], remainder='drop')
regr = TransformedTargetRegressor(regressor=svm.LinearSVR(epsilon=0.0, tol=0.0001, C=1.0, loss='squared_epsilon_insensitive', fit_intercept=True, intercept_scaling=1.0, dual=True, verbose=0, random_state=None, max_iter=2000), transformer=StandardScaler())
model = make_pipeline(column_trans,regr) model.fit(X_train, y_train) y_pred = model.predict(X_test) print(mean_squared_error(y_test,y_pred))` executed in 52.6s,
`column_trans = ColumnTransformer( [('cats',OneHotEncoder(),cats_name), ('conts',StandardScaler(),cont_name)], remainder='drop')
regr = TransformedTargetRegressor(regressor=SVR(kernel='linear',epsilon=0.0, tol=0.0001, C=1.0, verbose=0, max_iter=2000) ,transformer=StandardScaler())
model = make_pipeline(column_trans,regr) model.fit(X_train, y_train)` executed in 7m 4s
I am using the latest master branch of thundersvm. Compared to serial sklearn (LibSVM), thundersvm is orders of magnitude slower. I am probably doing something wrong though.
I have tested this on a GTX 750 Ti and 1060 Ti with the same results. I have to stop thundersvm because it just seems like it will never end, while the serial sklearn takes 0.5 seconds on 50 000 instances of data (5 features).
Here is my test code if you would like to try replicate this (dataset is BNG_COMET: https://www.openml.org/d/5648):
ThunderSVM test:
Sklearn test: