41 references to ModelFileUtils
Microsoft.ML.Data (41)
Commands\DataCommand.cs (7)
206return ModelFileUtils.LoadLoader(Host, rep, new MultiFileSource(path), loadTransforms); 265predictor = ModelFileUtils.LoadPredictorOrNull(Host, rep); 299var trainRoleMappings = ModelFileUtils.LoadRoleMappingsOrNull(Host, rep); 307trainPipe = ModelFileUtils.LoadLoader(Host, rep, new MultiFileSource(null), loadTransforms: true); 388using (var pipeLoaderEntry = rep.OpenEntry(ModelFileUtils.DirDataLoaderModel, ModelLoadContext.ModelStreamName)) 389using (var ctx = new ModelLoadContext(rep, pipeLoaderEntry, ModelFileUtils.DirDataLoaderModel)) 424ModelSaveContext.SaveModel(rep, loader, ModelFileUtils.DirDataLoaderModel);
Commands\SavePredictorCommand.cs (4)
215ModelLoadContext.LoadModel<IPredictor, SignatureLoadModel>(env, out predictor, rep, ModelFileUtils.DirPredictor); 219var roles = ModelFileUtils.LoadRoleMappingsOrNull(env, rep); 222var emptyView = ModelFileUtils.LoadPipeline(env, rep, new MultiFileSource(null)); 228if (ModelFileUtils.TryLoadFeatureNames(out names, rep))
Commands\TrainCommand.cs (6)
298return ModelLoadContext.LoadModelOrNull<IPredictor, SignatureLoadModel>(env, out inputPredictor, rep, ModelFileUtils.DirPredictor); 359ModelSaveContext.SaveModel(rep, predictor, ModelFileUtils.DirPredictor); 365ModelSaveContext.SaveModel(rep, dataPipe, ModelFileUtils.DirDataLoaderModel); 373using (var ent = rep.CreateEntry(ModelFileUtils.DirTrainingInfo, "Command.txt")) 377ModelFileUtils.SaveRoleMappings(env, ch, data.Schema, rep); 407using (var ctx = ModelFileUtils.GetDataModelSavingContext(repositoryWriter))
DataLoadSave\TransformerChain.cs (3)
290var chain = ModelFileUtils.LoadPipeline(env, stream, new MultiFileSource(null), extractInnerPipe: false); 292var predictor = ModelFileUtils.LoadPredictorOrNull(env, stream); 295var roles = ModelFileUtils.LoadRoleMappingsOrNull(env, stream);
DataView\DataViewConstructionUtils.cs (1)
131var roles = ModelFileUtils.LoadRoleMappingsOrNull(env, modelStream);
EntryPoints\PredictorModelImpl.cs (2)
51var roles = ModelFileUtils.LoadRoleMappingsOrNull(env, stream); 55Predictor = ModelFileUtils.LoadPredictorOrNull(env, stream);
EntryPoints\TransformModelImpl.cs (1)
116_chain = ModelFileUtils.LoadPipeline(env, stream, new MultiFileSource(null), extractInnerPipe: true);
Model\ModelOperationsCatalog.cs (1)
182var loader = ModelFileUtils.LoadLoader(_env, rep, new MultiFileSource(null), false);
Prediction\Calibrator.cs (2)
269ctx.SaveModel(SubModel, ModelFileUtils.DirPredictor); 276ctx.LoadModel<TSubModel, SignatureLoadModel>(env, out predictor, ModelFileUtils.DirPredictor);
Scorers\FeatureContributionCalculation.cs (2)
152ctx.LoadModel<IFeatureContributionMapper, SignatureLoadModel>(env, out Predictor, ModelFileUtils.DirPredictor); 182ctx.SaveModel(Predictor, ModelFileUtils.DirPredictor);
Scorers\SchemaBindablePredictorWrapper.cs (2)
77ctx.LoadModel<IPredictor, SignatureLoadModel>(env, out Predictor, ModelFileUtils.DirPredictor); 91ctx.SaveModel(Predictor, ModelFileUtils.DirPredictor);
Transforms\FeatureContributionCalculationTransformer.cs (2)
121ctx.LoadModel<IFeatureContributionMapper, SignatureLoadModel>(env, out _predictor, ModelFileUtils.DirPredictor); 142ctx.SaveModel(_predictor, ModelFileUtils.DirPredictor);
Transforms\TrainAndScoreTransformer.cs (2)
89ModelLoadContext.LoadModel<IPredictor, SignatureLoadModel>(env, out predictor, rep, ModelFileUtils.DirPredictor); 90trainSchema = ModelFileUtils.LoadRoleMappedSchemaOrNull(env, rep);
Utilities\ComponentCreation.cs (2)
74return ModelFileUtils.LoadTransforms(env, data, modelStream); 212return ModelFileUtils.LoadPredictorOrNull(env, modelStream);
Utilities\ModelFileUtils.cs (4)
212using (var ent = rep.OpenEntryOrNull(ModelFileUtils.DirTrainingInfo, "FeatureNames.bin")) 216using (var ctx = new ModelLoadContext(rep, ent, ModelFileUtils.DirTrainingInfo)) 347var roleMappings = ModelFileUtils.LoadRoleMappingsOrNull(env, rep); 350var pipe = ModelFileUtils.LoadLoader(h, rep, new MultiFileSource(null), loadTransforms: true);