Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Update entrypoints and MarshallInvoke call #461

Merged
merged 3 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/DotNetBridge/transforms/VariableColumnTransform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ public override bool IsColumnActive(DataViewSchema.Column column)
return _active[column.Index];
}

private static readonly FuncInstanceMethodInfo1<Cursor, DataViewRow, Delegate> _makeVarLengthVectorGetterMethodInfo
= FuncInstanceMethodInfo1<Cursor, DataViewRow, Delegate>.Create(target => target.MakeVarLengthVectorGetter<int>);

private Delegate MakeVarLengthVectorGetter<T>(DataViewRow input)
{
var srcGetters = new ValueGetter<T>[_bindings.vectorToInputMap.Count];
Expand Down Expand Up @@ -304,7 +307,7 @@ public override ValueGetter<TValue> GetGetter<TValue>(DataViewSchema.Column colu
if (column.Index == _bindings.outputColumn)
{
VectorDataViewType columnType = column.Type as VectorDataViewType;
Delegate getter = Utils.MarshalInvoke(MakeVarLengthVectorGetter<int>, columnType.ItemType.RawType, _cursor);
Delegate getter = Utils.MarshalInvoke(_makeVarLengthVectorGetterMethodInfo, this, columnType.ItemType.RawType, _cursor);
return getter as ValueGetter<TValue>;
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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).
Expand Down
12 changes: 6 additions & 6 deletions src/python/tools/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
],
Expand Down Expand Up @@ -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"
],
Expand Down