{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/698","labels_url":"https://api.github.com/repos/dmlc/xgboost/issues/698/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/xgboost/issues/698/comments","events_url":"https://api.github.com/repos/dmlc/xgboost/issues/698/events","html_url":"https://github.com/dmlc/xgboost/issues/698","id":123076870,"number":698,"title":"what():  AUC: the dataset only contains pos or neg samples","user":{"login":"mahdiman","id":8143219,"avatar_url":"https://avatars.githubusercontent.com/u/8143219?v=3","gravatar_id":"","url":"https://api.github.com/users/mahdiman","html_url":"https://github.com/mahdiman","followers_url":"https://api.github.com/users/mahdiman/followers","following_url":"https://api.github.com/users/mahdiman/following{/other_user}","gists_url":"https://api.github.com/users/mahdiman/gists{/gist_id}","starred_url":"https://api.github.com/users/mahdiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahdiman/subscriptions","organizations_url":"https://api.github.com/users/mahdiman/orgs","repos_url":"https://api.github.com/users/mahdiman/repos","events_url":"https://api.github.com/users/mahdiman/events{/privacy}","received_events_url":"https://api.github.com/users/mahdiman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-19T10:16:41Z","updated_at":"2016-01-15T04:56:59Z","closed_at":null,"body":"I'm trying to train a multi-class classifier using xgboost, here is my code:\r\n\r\n\r\nimport numpy as np\r\nimport sys\r\nimport xgboost as xgb\r\nif __name__ == \"__main__\":\r\n\r\n\tif len(sys.argv) < 3:\r\n\t\tprint 'Args: '\r\n\t\tprint '1- train data'\r\n\t\tprint '2- test data'\r\n\t\texit()\r\n\t\r\n\t# train\r\n\tdata = np.load(sys.argv[1])\r\n\ttrainF = data['features']\r\n\ttrainL = data['labels']\r\n\tdata.close()\r\n\r\n\t# test\r\n\tdata = np.load(sys.argv[2])\r\n\ttestF = data['features']\r\n\ttestL = data['labels']\r\n\tdata.close()\r\n\r\n\tdtrain = xgb.DMatrix(trainF, label = trainL)\r\n\tdtest = xgb.DMatrix(testF, label = testL)\r\n\r\n\r\n\tparam = {'bst:max_depth':2, 'bst:eta':1, 'silent':1, 'objective':'multi:softmax'}\r\n\tparam['num_class'] = 20\r\n\tparam['nthread'] = 2\r\n\tparam['eval_metric'] = 'auc'\r\n\tevallist  = [(dtest,'eval'), (dtrain,'train')]\r\n\tnum_round = 10\r\n\tplst = param.items()\r\n\r\n\tbst = xgb.train( plst, dtrain, num_round, evallist)\r\n\tbst.save_model('0001.model')\r\n\r\nthe trainF and testF are numpy matrices containing feature vectors and trainL and testL are numpy arrays containing labels for train and test, the feature vectors contain only of zeros and ones. can any one tell me why it's wrong to have a dataset of only zeros and ones? "},"comment":{"url":"https://api.github.com/repos/dmlc/xgboost/issues/comments/171872081","html_url":"https://github.com/dmlc/xgboost/issues/698#issuecomment-171872081","issue_url":"https://api.github.com/repos/dmlc/xgboost/issues/698","id":171872081,"user":{"login":"tqchen","id":2577440,"avatar_url":"https://avatars.githubusercontent.com/u/2577440?v=3","gravatar_id":"","url":"https://api.github.com/users/tqchen","html_url":"https://github.com/tqchen","followers_url":"https://api.github.com/users/tqchen/followers","following_url":"https://api.github.com/users/tqchen/following{/other_user}","gists_url":"https://api.github.com/users/tqchen/gists{/gist_id}","starred_url":"https://api.github.com/users/tqchen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tqchen/subscriptions","organizations_url":"https://api.github.com/users/tqchen/orgs","repos_url":"https://api.github.com/users/tqchen/repos","events_url":"https://api.github.com/users/tqchen/events{/privacy}","received_events_url":"https://api.github.com/users/tqchen/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T04:56:59Z","updated_at":"2016-01-15T04:56:59Z","body":"The AUC metric is only designed for binary classifiers"}}