1
$\begingroup$

Is there a way to perform a hyperparameter grid search with Orange?

$\endgroup$

4 Answers 4

0
$\begingroup$

Yes, you can perform a hyperparameter grid search with Orange by using the GridSearchCV class from the sklearn.model_selection module, as Orange itself doesn't provide a built-in method for hyperparameter grid search. Since Orange is built on top of scikit-learn, it is compatible with scikit-learn's tools and models.

import Orange from sklearn.datasets import load_iris from sklearn.model_selection import GridSearchCV from sklearn.tree import DecisionTreeClassifier from sklearn.pipeline import Pipeline from sklearn import preprocessing #load the data and convert it into an Orange table iris = load_iris() iris_data = Orange.data.Table(iris.data, iris.target) #Create a scikit-learn pipeline with the desired preprocessor and estimator pipeline = Pipeline([ ('scaler', preprocessing.StandardScaler()), # Preprocessing (optional) ('classifier', DecisionTreeClassifier()) # Your classifier (e.g., Decision Tree) ]) #define the hyperparameter search grid param_grid = { 'scaler': [preprocessing.StandardScaler(), preprocessing.MinMaxScaler()], 'classifier__criterion': ['gini', 'entropy'], 'classifier__max_depth': [3, 4, 5, 6] } #create the GridSearchCV object and fit it into data grid_search = GridSearchCV(pipeline, param_grid, scoring='accuracy', cv=5) grid_search.fit(iris_data.X, iris_data.Y) #print the best hyperparameters and corresponding scores print("Best hyperparameters:", grid_search.best_params_) print("Best score:", grid_search.best_score_) 
Best hyperparameters: {'classifier__criterion': 'gini', 'classifier__max_depth': 4, 'scaler': MinMaxScaler()} Best score: 0.9666666666666668 
$\endgroup$
0
$\begingroup$

Aside from switching to the programmatic approach as in Rohit's answer, it appears not possible yet. There's ParameterFitter, but it is limited to one integer-valued hyperparameter. Here's a github Issue for the more general case, but no indication of progress from what I can tell.

$\endgroup$
-1
$\begingroup$

U just swap the most easy to use tool with cli based one ! Isn't the whole point of ease of use software not to bother user with cli tool at all ? If user is forced to cli then he has to code it for him self, now huge drawbacks of using Cli is writing the same or similar code all over again and again (for CLi lovers not the problem, typing their fingers bleed, for what purpose do we have GUI and mouse invented ??? FOR EASE OF USE,AND BEING PRODUCTIVE and NOT TO BE STUCK IN CLI AT EVERY REQUERED COMMAND !!!), the more the code, the more logical and other error can and will occur, for to using cli u have know exactly what u doing, which command syntax, how and why. The open source in this field is mainly about all about CLi all over the place ! It's a shame that developer of Orange still doesn't implement some already open source tool available to help estimate hyperparameters with widget. And ordinary tutorials how to do it manually do not appley for Orange due MRSE error curve plot u don't have support for for estimating minima of error. U can only use ROC widget curve plot which increase are under plot when AUC goes up/down down gives some clue where to search and change to try to optimizing hyperparameters, but basically u re flying blind here. And this lack of feature makes Orange from easy to use to unusable. Orange created only for classifying task job and not for predictions as target column once specified fixes it there and Orange try to predict this column variable on all predictions datasets and can not predict future column next to target one. That's why i switched to MatLab ! Who wants the whole life in Cli ? I do not and DOS-OS proves it decades ago! It's time for developers to wake up and start to think for ease of use whatever software they develop. That's why so many people use libraries and scripts ? And let me say something about python also, its slow language coz is sequential in execution, relaying on slow cpu's only and do not support parallel processing out of the box, adding CUDA support for python is mission impossible, in this case user try to do developers job. MatLab and some other solutions do support parallel processing out of the box. So think twice what u learn and use to not to be disappoint at the end. If u re newbie to this kind of field's u wont achieve something soon, but way, way later.

$\endgroup$
1
-1
$\begingroup$

GridSearch and Optuna overfit on what so ever HPO every time ! Getting high AUC on test data but when using the same HPO on real model AUC test on test data drops to 50% or less and model finds result by the chance only !? How come ? Optuna lies ? Finding HP manually well .... this one is eternity job in infinity, meaning yu'l newer find it due vastness of possibility's that by far on exp exceed winning toughest loto on earth. We need software that delivers results otherwise it is useless.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.