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

Commit 2700e18

Browse files
authored
Merge master in to temp/docs. (#234)
* More doc fixes (#228) * More doc fixes * A few nits * Pass python path to Dprep (#232) * Remove all underscore files which are not getting recognized as renamed. * Rename the files to start with an underscore character. * Update the previously renamed files with underscores where required. * Finish merge of nimbusml.pyproj from master.
1 parent 4a20458 commit 2700e18

23 files changed

+90
-82
lines changed

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ if /i [%1] == [--azureBuild] (
5959
) else goto :Usage
6060

6161
:Usage
62-
echo "Usage: build.cmd [--configuration <Configuration>] [--runTests] [--includeExtendedTests] [--buildDotNetBridgeOnly] [--skipDotNetBridge] [--azureBuild]"
62+
echo "Usage: build.cmd [--configuration <Configuration>] [--runTests] [--installPythonPackages] [--includeExtendedTests] [--buildDotNetBridgeOnly] [--skipDotNetBridge] [--azureBuild]"
6363
echo ""
6464
echo "Options:"
6565
echo " --configuration <Configuration> Build Configuration (DbgWinPy3.7,DbgWinPy3.6,DbgWinPy3.5,DbgWinPy2.7,RlsWinPy3.7,RlsWinPy3.6,RlsWinPy3.5,RlsWinPy2.7)"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mkdir -p "${DependenciesDir}"
1111

1212
usage()
1313
{
14-
echo "Usage: $0 --configuration <Configuration> [--runTests] [--includeExtendedTests]"
14+
echo "Usage: $0 --configuration <Configuration> [--runTests] [--includeExtendedTests] [--installPythonPackages]"
1515
echo ""
1616
echo "Options:"
1717
echo " --configuration <Configuration> Build Configuration (DbgLinPy3.7,DbgLinPy3.6,DbgLinPy3.5,DbgLinPy2.7,RlsLinPy3.7,RlsLinPy3.6,RlsLinPy3.5,RlsLinPy2.7,DbgMacPy3.7,DbgMacPy3.6,DbgMacPy3.5,DbgMacPy2.7,RlsMacPy3.7,RlsMacPy3.6,RlsMacPy3.5,RlsMacPy2.7)"

src/DotNetBridge/Bridge.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ private struct EnvironmentBlock
242242
// Call back to provide cancel flag.
243243
[FieldOffset(0x28)]
244244
public readonly void* checkCancel;
245+
246+
// Path to python executable.
247+
[FieldOffset(0x30)]
248+
public readonly sbyte* pythonPath;
245249
#pragma warning restore 649 // never assigned
246250
}
247251

src/DotNetBridge/DotNetBridge.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<PackageReference Include="Microsoft.ML.Dnn" Version="0.15.1" />
4343
<PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.1" />
4444
<PackageReference Include="Microsoft.ML.TimeSeries" Version="1.3.1" />
45-
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.5-preview" />
45+
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.12-preview" />
4646
<PackageReference Include="TensorFlow.NET" Version="0.10.10" />
4747
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" />
4848
</ItemGroup>

src/DotNetBridge/RunGraph.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,11 @@ private static void RunGraphCore(EnvironmentBlock* penv, IHostEnvironment env, s
147147
var extension = Path.GetExtension(path);
148148
if (extension == ".txt")
149149
dv = TextLoader.LoadFile(host, new TextLoader.Options(), new MultiFileSource(path));
150-
else if(extension == ".dprep")
150+
else if (extension == ".dprep")
151+
{
152+
DPrepSettings.Instance.PythonPath = BytesToString(penv->pythonPath);
151153
dv = DataFlow.FromDPrepFile(path).ToDataView();
154+
}
152155
else
153156
dv = new BinaryLoader(host, new BinaryLoader.Arguments(), path);
154157
}

src/NativeBridge/ManagedInterop.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ EnvironmentBlock::~EnvironmentBlock()
7777
FillDead(_vset[i]);
7878
}
7979

80-
EnvironmentBlock::EnvironmentBlock(int verbosity, int maxThreadsAllowed, int seed)
80+
EnvironmentBlock::EnvironmentBlock(int verbosity, int maxThreadsAllowed, int seed, const char* pythonPath)
8181
{
8282
// Assert that this class doesn't have a vtable.
8383
assert(offsetof(EnvironmentBlock, verbosity) == 0);
@@ -86,6 +86,7 @@ EnvironmentBlock::EnvironmentBlock(int verbosity, int maxThreadsAllowed, int see
8686
this->verbosity = verbosity;
8787
this->maxThreadsAllowed = maxThreadsAllowed;
8888
this->seed = seed;
89+
this->pythonPath = pythonPath;
8990
this->_kindMask = (1 << Warning) | (1 << Error);
9091
if (verbosity > 0)
9192
this->_kindMask |= (1 << Info);

src/NativeBridge/ManagedInterop.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,11 @@ class CLASS_ALIGN EnvironmentBlock
8181
// Check cancellation flag.
8282
CHECKCANCEL checkCancel;
8383

84+
// Path to python executable
85+
const char* pythonPath;
86+
8487
public:
85-
EnvironmentBlock(int verbosity = 0, int maxThreadsAllowed = 0, int seed = 42);
88+
EnvironmentBlock(int verbosity = 0, int maxThreadsAllowed = 0, int seed = 42, const char* pythonPath = NULL);
8689
~EnvironmentBlock();
8790
PyErrorCode GetErrorCode() { return _errCode; }
8891
std::string GetErrorMessage() { return _errMessage; }

src/NativeBridge/dllmain.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#define PARAM_MLNET_PATH "mlnetPath"
1313
#define PARAM_DOTNETCLR_PATH "dotnetClrPath"
1414
#define PARAM_DPREP_PATH "dprepPath"
15+
#define PARAM_PYTHON_PATH "pythonPath"
1516
#define PARAM_DATA "data"
1617

1718

@@ -74,13 +75,15 @@ bp::dict pxCall(bp::dict& params)
7475
bp::extract<std::string> mlnetPath(params[PARAM_MLNET_PATH]);
7576
bp::extract<std::string> dotnetClrPath(params[PARAM_DOTNETCLR_PATH]);
7677
bp::extract<std::string> dprepPath(params[PARAM_DPREP_PATH]);
77-
bp::extract<std::int32_t> verbose(params[PARAM_VERBOSE]);
78+
bp::extract<std::string> pythonPath(params[PARAM_PYTHON_PATH]);
79+
bp::extract<std::int32_t> verbose(params[PARAM_VERBOSE]);
7880
std::int32_t i_verbose = std::int32_t(verbose);
7981
std::string s_mlnetPath = std::string(mlnetPath);
8082
std::string s_dotnetClrPath = std::string(dotnetClrPath);
8183
std::string s_dprepPath = std::string(dprepPath);
82-
std::string s_graph = std::string(graph);
83-
const char *mlnetpath = s_mlnetPath.c_str();
84+
std::string s_pythonPath = std::string(pythonPath);
85+
std::string s_graph = std::string(graph);
86+
const char *mlnetpath = s_mlnetPath.c_str();
8487
const char *coreclrpath = s_dotnetClrPath.c_str();
8588
const char *dpreppath = s_dprepPath.c_str();
8689

@@ -93,7 +96,7 @@ bp::dict pxCall(bp::dict& params)
9396
if (params.has_key(PARAM_SEED))
9497
seed = bp::extract<int>(params[PARAM_SEED]);
9598

96-
EnvironmentBlock env(i_verbose, 0, seed);
99+
EnvironmentBlock env(i_verbose, 0, seed, s_pythonPath.c_str());
97100
int retCode;
98101
if (params.has_key(PARAM_DATA) && bp::extract<bp::dict>(params[PARAM_DATA]).check())
99102
{

src/Platforms/build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageReference Include="Microsoft.ML.Dnn" Version="0.15.1" />
2323
<PackageReference Include="Microsoft.ML.Ensemble" Version="0.15.1" />
2424
<PackageReference Include="Microsoft.ML.TimeSeries" Version="1.3.1" />
25-
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.5-preview" />
25+
<PackageReference Include="Microsoft.DataPrep" Version="0.0.1.12-preview" />
2626
<PackageReference Include="TensorFlow.NET" Version="0.10.10" />
2727
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="1.14.0" />
2828
</ItemGroup>

src/python/docs/docstrings/EnsembleClassifier.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
* ``RandomFeatureSelector``: selects a random subset of the features
3131
for each model.
3232

33-
:param num_models: indicates the number models to train, i.e. the number of
33+
:param num_models: Indicates the number models to train, i.e. the number of
3434
subsets of the training set to sample. The default value is 50. If
3535
batches are used then this indicates the number of models per batch.
3636

3737
:param sub_model_selector_type: Determines the efficient set of models the
38-
``output_combiner`` uses, and removes the least significant models. This is
39-
used to improve the accuracy and reduce the model size. This is also called
40-
pruning.
38+
``output_combiner`` uses, and removes the least significant models.
39+
This is used to improve the accuracy and reduce the model size. This is
40+
also called pruning.
4141

4242
* ``ClassifierAllSelector``: does not perform any pruning and selects
4343
all models in the ensemble to combine to create the output. This is
@@ -51,9 +51,9 @@
5151
or ``"LogLossReduction"``.
5252

5353

54-
:param output_combiner: indicates how to combine the predictions of the different
55-
models into a single prediction. There are five available output
56-
combiners for clasification:
54+
:param output_combiner: Indicates how to combine the predictions of the
55+
different models into a single prediction. There are five available
56+
outputcombiners for clasification:
5757

5858
* ``ClassifierAverage``: computes the average of the scores produced by
5959
the trained models.
@@ -92,7 +92,7 @@
9292
and ``0 <= b <= 1`` and ``b - a = 1``. This normalizer preserves
9393
sparsity by mapping zero to zero.
9494

95-
:param batch_size: train the models iteratively on subsets of the training
95+
:param batch_size: Train the models iteratively on subsets of the training
9696
set of this size. When using this option, it is assumed that the
9797
training set is randomized enough so that every batch is a random
9898
sample of instances. The default value is -1, indicating using the

0 commit comments

Comments
 (0)