You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using v0.7.
Issue: Saving a DataView to a file should be simpler and not having to directly use the LocalEnvironment class.
If there's any new way to do this in v0.7 or v08, please tell me, but I haven't found it. :)
As far as I know, this is the code needed, currently:
// save test split dataset
IHostEnvironment env = (IHostEnvironment)mlContext;
using (var ch = env.Start("SaveData"))
using (var file = env.CreateOutputFile(Path.Combine(_outputPath, "testData.idv")))
{
var saver = new BinarySaver(mlContext, new BinarySaver.Arguments());
DataSaverUtils.SaveDataView(ch, saver, testDataView, file);
}
First, it needs to use the IChannel object that has to be obtained from the IHostEnvironment object that you can get by casting the MLContext object to IHostEnvironment. The developer shouldn't need to use IHostEnvironment in any case, I think.
Then, still a few more lines for saving the file.
We should aim to achieve a simpler API for doing this, just something like:
MLContext.Data.SaveAsText -- generally the common idiom in 0.7 and going forward we think will be that this will be the central structure to "find" commonly used operations. Please refer to #1098 to familiarize yourself with the idiom.
Sort of a factory of everything. That's not an antipattern, is it? 😉
I'm using v0.7.
Issue: Saving a DataView to a file should be simpler and not having to directly use the LocalEnvironment class.
If there's any new way to do this in v0.7 or v08, please tell me, but I haven't found it. :)
As far as I know, this is the code needed, currently:
First, it needs to use the
IChannel
object that has to be obtained from theIHostEnvironment
object that you can get by casting theMLContext
object toIHostEnvironment
. The developer shouldn't need to useIHostEnvironment
in any case, I think.Then, still a few more lines for saving the file.
We should aim to achieve a simpler API for doing this, just something like:
testDataView.SaveToFile(testDataSetFilePath);
Or if we need to do it through any utility class:
DataSaverUtils.SaveDataViewToFile(testDataView, testDataSetFilePath);
The text was updated successfully, but these errors were encountered: