{"action":"closed","issue":{"url":"https://api.github.com/repos/claesenm/optunity/issues/53","labels_url":"https://api.github.com/repos/claesenm/optunity/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/claesenm/optunity/issues/53/comments","events_url":"https://api.github.com/repos/claesenm/optunity/issues/53/events","html_url":"https://github.com/claesenm/optunity/issues/53","id":103031904,"number":53,"title":"Unexpected working of maximize_structured function when using multiple arguments","user":{"login":"suzukikbp","id":11338577,"avatar_url":"https://avatars.githubusercontent.com/u/11338577?v=3","gravatar_id":"","url":"https://api.github.com/users/suzukikbp","html_url":"https://github.com/suzukikbp","followers_url":"https://api.github.com/users/suzukikbp/followers","following_url":"https://api.github.com/users/suzukikbp/following{/other_user}","gists_url":"https://api.github.com/users/suzukikbp/gists{/gist_id}","starred_url":"https://api.github.com/users/suzukikbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suzukikbp/subscriptions","organizations_url":"https://api.github.com/users/suzukikbp/orgs","repos_url":"https://api.github.com/users/suzukikbp/repos","events_url":"https://api.github.com/users/suzukikbp/events{/privacy}","received_events_url":"https://api.github.com/users/suzukikbp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/claesenm/optunity/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/claesenm/optunity/labels/Python","name":"Python","color":"207de5"}],"state":"closed","locked":false,"assignee":{"login":"claesenm","id":5254910,"avatar_url":"https://avatars.githubusercontent.com/u/5254910?v=3","gravatar_id":"","url":"https://api.github.com/users/claesenm","html_url":"https://github.com/claesenm","followers_url":"https://api.github.com/users/claesenm/followers","following_url":"https://api.github.com/users/claesenm/following{/other_user}","gists_url":"https://api.github.com/users/claesenm/gists{/gist_id}","starred_url":"https://api.github.com/users/claesenm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claesenm/subscriptions","organizations_url":"https://api.github.com/users/claesenm/orgs","repos_url":"https://api.github.com/users/claesenm/repos","events_url":"https://api.github.com/users/claesenm/events{/privacy}","received_events_url":"https://api.github.com/users/claesenm/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-25T14:15:47Z","updated_at":"2015-09-11T12:27:51Z","closed_at":"2015-09-11T12:27:51Z","body":"I would like to optimize features' weight and classifier's parameters at the same time using maximize_structured function. I specified search space as below (F1 corresponds to the first feature. In this case, there are 11 features to optimize their weight), and used it in the maximize_structured function. However, after the optimization of first iteration, arguments changed like below, which just returns 'None' for 'weight' argument and optimizes just  'algorithm' arguments. I expected that all parameters of 'weight' argument (i.e. F1-F11) are optimized as well.  How can I optimize 'weight' at the same time with optimization for classifier?\r\n\r\n\r\n\tself.search=\r\n\t{'algorithm': {'SVM': {'kernel': {'linear': {'C': [-5, 2]},\r\n\t                                  'poly': {'C': [-5, 2],\r\n\t                                           'coef0': [0, 1],\r\n\t                                           'degree': [2, 5]},\r\n\t                                  'rbf': {'C': [-5, 2], 'gamma': [-5, 2]}}},\r\n\t               'naive-bayes': None,\r\n\t               'random-forest': {'max_features': [2, 1096],\r\n\t                                 'n_estimators': [10, 30]}},\r\n\t 'weight': {'F1': [1, 10],\r\n\t            'F10': [1, 10],\r\n\t            'F11': [1, 10],\r\n\t            'F2': [1, 10],\r\n\t            'F3': [1, 10],\r\n\t            'F4': [1, 10],\r\n\t            'F5': [1, 10],\r\n\t            'F6': [1, 10],\r\n\t            'F7': [1, 10],\r\n\t            'F8': [1, 10],\r\n\t            'F9': [1, 10]}}\r\n\r\nThis is the arguments that I got inside the performance function.\r\n\r\n\tkargs\r\n\t{'C': 0.88232421875,\r\n\t 'F1': None,\r\n\t 'F10': None,\r\n\t 'F11': None,\r\n\t 'F2': None,\r\n\t 'F3': None,\r\n\t 'F4': None,\r\n\t 'F5': None,\r\n\t 'F6': None,\r\n\t 'F7': None,\r\n\t 'F8': None,\r\n\t 'F9': None,\r\n\t 'algorithm': 'SVM',\r\n\t 'coef0': 0.04931640625,\r\n\t 'degree': 3.49853515625,\r\n\t 'gamma': None,\r\n\t 'kernel': 'poly',\r\n\t 'max_features': None,\r\n\t 'n_estimators': None}\r\n\r\nHere is the code where I use the search space and get the arguments 'kargs'.\r\n\r\n    @optunity.cross_validated(x=self.xtrain, y=self.ytrain, num_folds=num_folds, num_iter=num_iter)\r\n    def performance(x_train, y_train, x_test, y_test,**kargs):\r\n        xtrain,xtest=setWeight(xtrain,xtest,**kargs)\r\n        model,_=setModel(**kargs)\r\n        model.fit(x_train, y_train)\r\n        # predict the test set\r\n        if kargs['algorithm'] == 'SVM':\r\n            predictions = model.decision_function(x_test)\r\n        else:\r\n            predictions = model.predict_proba(x_test)[:, 1]\r\n        return optunity.metrics.roc_auc(y_test, predictions)\r\n\r\n    optimal_configuration, info, optimal_pars3 = optunity.maximize_structured(performance,search_space=self.search,num_evals=num_evals)\r\n\r\n"}}