Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 3c4b53fe

Přidáno uživatelem Roman Kalivoda před téměř 4 roky(ů)

Re #9049 Implemented Rollback method

Zobrazit rozdíly:

Server/ServerApp/Predictor/NaiveBayesClassifier.cs
47 47
            this._predictionEngine = _mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(this._trainedModel);
48 48
        }
49 49

  
50
        public void Save(string filename)
51
        {
52
            if (this._trainingDataView is null)
53
            {
54
                throw new NullReferenceException("DataView is not set.");
55
            }
56
            if( this._trainedModel is null)
57
            {
58
                throw new NullReferenceException("Trained model instance does not exist. This predictor has not been trained yet.");
59
            }
60
            if(filename is null)
61
            {
62
                throw new ArgumentNullException(nameof(filename));
63
            }
64
            this._mlContext.Model.Save(this._trainedModel, this._trainingDataView.Schema, filename);
65
        }
66

  
50 67
        public void Fit(IEnumerable<ModelInput> trainInput)
51 68
        {
52 69
            this._trainingDataView = _mlContext.Data.LoadFromEnumerable(trainInput);

Také k dispozici: Unified diff