def sk_generate_random_classification_set(self, samples, features, classes, informative, rds, dbs, debug=False):
record = {
"Test" : {
"X" : {},
"Y" : {}
},
"Train" : {
"X" : {},
"Y" : {}
}
}
results = self.build_def_hash("Display Error", "Not Run", record )
try:
from sklearn.datasets import make_classification
self.lg("Processing ROC", 6)
X, Y = make_classification(n_samples=samples,
n_features=features,
n_classes=classes,
n_informative=informative)
record["Test"]["X"] = X[9000:]
record["Test"]["Y"] = Y[9000:]
record["Train"]["X"] = X[:9000]
record["Train"]["Y"] = Y[:9000]
results = self.build_def_hash("SUCCESS", "", record)
except Exception,k:
status = "FAILED"
err_msg = "Unable to Generate Random Classification set with Ex(" + str(k) + ")"
self.lg("ERROR: " + str(err_msg), 0)
results = self.build_def_hash("Display Error", err_msg, {})
# end of try/ex
return results
# end of sk_generate_random_classification_set
评论列表
文章目录