From ac15909507cb9bd2529b7185e40ff33b79b4040d Mon Sep 17 00:00:00 2001 From: Antonio Velazquez Date: Thu, 5 Mar 2020 11:15:14 -0800 Subject: [PATCH 1/3] Update manifest.json --- src/python/tools/manifest.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/python/tools/manifest.json b/src/python/tools/manifest.json index eb019968..fd7f7950 100644 --- a/src/python/tools/manifest.json +++ b/src/python/tools/manifest.json @@ -1731,14 +1731,14 @@ { "Name": "Slope", "Type": "Float", - "Desc": "The slope parameter of the calibration function 1 / (1 + exp(-slope * x + offset)", + "Desc": "The slope parameter of the calibration function 1 / (1 + exp(slope * x + offset)", "Aliases": [ "slope" ], "Required": false, "SortOrder": 1.0, "IsNullable": false, - "Default": 1.0 + "Default": -1.0 }, { "Name": "Data", @@ -1762,7 +1762,7 @@ { "Name": "Offset", "Type": "Float", - "Desc": "The offset parameter of the calibration function 1 / (1 + exp(-slope * x + offset)", + "Desc": "The offset parameter of the calibration function 1 / (1 + exp(slope * x + offset)", "Aliases": [ "offset" ], @@ -25355,19 +25355,19 @@ { "Name": "Slope", "Type": "Float", - "Desc": "The slope parameter of f(x) = 1 / (1 + exp(-slope * x + offset)", + "Desc": "The slope parameter of f(x) = 1 / (1 + exp(slope * x + offset)", "Aliases": [ "a" ], "Required": false, "SortOrder": 150.0, "IsNullable": false, - "Default": 1.0 + "Default": -1.0 }, { "Name": "Offset", "Type": "Float", - "Desc": "The offset parameter of f(x) = 1 / (1 + exp(-slope * x + offset)", + "Desc": "The offset parameter of f(x) = 1 / (1 + exp(slope * x + offset)", "Aliases": [ "b" ], From a35f9de02ca518399774536133d852744b9e68ec Mon Sep 17 00:00:00 2001 From: Antonio Velazquez Date: Thu, 5 Mar 2020 11:15:27 -0800 Subject: [PATCH 2/3] Update VariableColumnTransform.cs --- src/DotNetBridge/transforms/VariableColumnTransform.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DotNetBridge/transforms/VariableColumnTransform.cs b/src/DotNetBridge/transforms/VariableColumnTransform.cs index ea9ecafb..9ee1ebd7 100644 --- a/src/DotNetBridge/transforms/VariableColumnTransform.cs +++ b/src/DotNetBridge/transforms/VariableColumnTransform.cs @@ -247,6 +247,9 @@ public override bool IsColumnActive(DataViewSchema.Column column) return _active[column.Index]; } + private static readonly FuncInstanceMethodInfo1 _makeVarLengthVectorGetterMethodInfo + = FuncInstanceMethodInfo1.Create(target => target.MakeVarLengthVectorGetter); + private Delegate MakeVarLengthVectorGetter(DataViewRow input) { var srcGetters = new ValueGetter[_bindings.vectorToInputMap.Count]; @@ -304,7 +307,7 @@ public override ValueGetter GetGetter(DataViewSchema.Column colu if (column.Index == _bindings.outputColumn) { VectorDataViewType columnType = column.Type as VectorDataViewType; - Delegate getter = Utils.MarshalInvoke(MakeVarLengthVectorGetter, columnType.ItemType.RawType, _cursor); + Delegate getter = Utils.MarshalInvoke(_makeVarLengthVectorGetterMethodInfo, this, columnType.ItemType.RawType, _cursor); return getter as ValueGetter; } else From 3ac72592508219afe19127e148c2a90ea4261acb Mon Sep 17 00:00:00 2001 From: Antonio Velazquez Date: Thu, 5 Mar 2020 11:33:31 -0800 Subject: [PATCH 3/3] Updated entrypoints --- .../entrypoints/_calibratortrainer_fixedplattcalibrator.py | 6 +++--- .../internal/entrypoints/models_fixedplattcalibrator.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/python/nimbusml/internal/entrypoints/_calibratortrainer_fixedplattcalibrator.py b/src/python/nimbusml/internal/entrypoints/_calibratortrainer_fixedplattcalibrator.py index 35e80514..8f1904cb 100644 --- a/src/python/nimbusml/internal/entrypoints/_calibratortrainer_fixedplattcalibrator.py +++ b/src/python/nimbusml/internal/entrypoints/_calibratortrainer_fixedplattcalibrator.py @@ -10,16 +10,16 @@ def fixed_platt_calibrator( - slope=1.0, + slope=-1.0, offset=0.0, **params): """ **Description** None - :param slope: The slope parameter of f(x) = 1 / (1 + exp(-slope * + :param slope: The slope parameter of f(x) = 1 / (1 + exp(slope * x + offset) (settings). - :param offset: The offset parameter of f(x) = 1 / (1 + exp(-slope + :param offset: The offset parameter of f(x) = 1 / (1 + exp(slope * x + offset) (settings). """ diff --git a/src/python/nimbusml/internal/entrypoints/models_fixedplattcalibrator.py b/src/python/nimbusml/internal/entrypoints/models_fixedplattcalibrator.py index f5665675..4876c6ff 100644 --- a/src/python/nimbusml/internal/entrypoints/models_fixedplattcalibrator.py +++ b/src/python/nimbusml/internal/entrypoints/models_fixedplattcalibrator.py @@ -13,7 +13,7 @@ def models_fixedplattcalibrator( data, uncalibrated_predictor_model, predictor_model=None, - slope=1.0, + slope=-1.0, offset=0.0, max_rows=1000000000, **params): @@ -23,12 +23,12 @@ def models_fixedplattcalibrator( model :param slope: The slope parameter of the calibration function 1 / - (1 + exp(-slope * x + offset) (inputs). + (1 + exp(slope * x + offset) (inputs). :param data: Input dataset (inputs). :param uncalibrated_predictor_model: The predictor to calibrate (inputs). :param offset: The offset parameter of the calibration function 1 - / (1 + exp(-slope * x + offset) (inputs). + / (1 + exp(slope * x + offset) (inputs). :param max_rows: The maximum number of examples to train the calibrator on (inputs). :param predictor_model: The trained model (outputs).