我有與多個得分手 我怎樣才能將它集成到一個自定義sklearn射手返回Observation
對象的功能? 我把它定義爲:sklearn定製的得分手多指標同時
class Observation():
def __init__(self):
self.statValues = {}
self.modelName = ""
def setModelName(self, nameOfModel):
self.modelName = nameOfModel
def addStatMetric(self, metricName,metricValue):
self.statValues[metricName] = metricValue
自定義分數的定義如下:
def myAllScore(y_true, y_predicted):
return Observation
my_scorer = make_scorer(myAllScore)
這可能看起來像
{ 'AUC_R': 0.6892943119440752,
'Accuracy': 0.9815382629183745,
'Error rate': 0.018461737081625407,
'False negative rate': 0.6211453744493393,
'False positive rate': 0.0002660016625103907,
'Lift value': 33.346741089307166,
'Precision J': 0.9772727272727273,
'Precision N': 0.9815872808592603,
'Rate of negative predictions': 0.0293063938288739,
'Rate of positive predictions': 0.011361068973307943,
'Sensitivity (true positives rate)': 0.3788546255506608,
'Specificity (true negatives rate)': 0.9997339983374897,
'f1_R': 0.9905775376404309,
'kappa': 0.5384745595159575}
我明白了。但是它可能類似於http://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html一次獲得幾個評分嗎? –
你已經實現了這個,因此我不明白你的問題。 classification_report不是記分員,您不能在記分員上下文中使用它。 – lejlot
正確。我手動實現了循環的列車測試。 Howeve,r,因爲我想嘗試堆疊和混合(https://github.com/rushter/heamy)我開始轉向sklearn管道,這很好地與記分器功能集成在一起。 –