public Insert2 GetModelStatus(ProjectModelId projectModelId) { var getRequest = PredictionService.Trainedmodels.Get(projectModelId.ProjectNumber, projectModelId.ModelId); Insert2 response = getRequest.Execute(); return(response); }
public string DeleteTrainedModel(ProjectModelId projectModelId) { var deleteRequest = PredictionService.Trainedmodels.Delete(projectModelId.ProjectNumber, projectModelId.ModelId); string deleteResponse = deleteRequest.Execute(); return(deleteResponse); }
public Insert2 TrainRegressionModel(ProjectModelId projectModelId, string csvDataPathInStorage) { Insert insertBody = new Insert { StorageDataLocation = csvDataPathInStorage, Id = projectModelId.ModelId, ModelType = "REGRESSION", }; TrainedmodelsResource.InsertRequest insertRequest = PredictionService.Trainedmodels.Insert(insertBody, projectModelId.ProjectNumber); Insert2 insertResponse = insertRequest.Execute(); return insertResponse; }
public Insert2 TrainRegressionModel(ProjectModelId projectModelId, string csvDataPathInStorage) { Insert insertBody = new Insert { StorageDataLocation = csvDataPathInStorage, Id = projectModelId.ModelId, ModelType = "REGRESSION", }; TrainedmodelsResource.InsertRequest insertRequest = PredictionService.Trainedmodels.Insert(insertBody, projectModelId.ProjectNumber); Insert2 insertResponse = insertRequest.Execute(); return(insertResponse); }
static void Main() { PredictionFramework predictionFramework = new PredictionFramework(); predictionFramework.CreatePredictionService(AUTH_JSON_FILE); ProjectModelId projectModelId = new ProjectModelId(PROJECT_NUMBER, "sin-360-sanity"); //ICommand command = new TrainingCommand(predictionFramework, projectModelId, "sanity-test-cases/sin-360-training-data.csv"); //ICommand command = new StatusCommand(predictionFramework, projectModelId); //ICommand command = new AnalysisCommand(predictionFramework, projectModelId); ICommand command = new PredictCommand(predictionFramework, projectModelId, @"D:\@Temp\ML_Feasibility\Tech.Sugar-ML-in-Cloud\GCPDemo\predict-data.csv"); Console.WriteLine("Project number: {0}, Model ID: {1}", projectModelId.ProjectNumber, projectModelId.ModelId); Console.WriteLine("Command: {0}", command.Command); command.Run(); }
// //const string AUTH_JSON_FILE = @"D:\@Temp\@Issues\2018-01-10_Igor_ML\data\google\data1p1x7-b93dbc2c7b4b.json"; // private const string AUTH_JSON_FILE = @"D:\@Temp\@Issues\2018-01-10_Igor_ML\data\google\HAR Machine Learning-2a2ea6fd74e3.json"; // private const string PROJECT_NUMBER = "1024476357063"; // private const string modelId = "data1x1p7"; // private const string storageData = "sanity-test-cases/data_1_gcp.csv"; //// private const string predictFile = @"D:\@Temp\@Issues\2018-01-10_Igor_ML\data\data_1_gcp_predict.csv"; static void Main() { PredictionFramework predictionFramework = new PredictionFramework(); predictionFramework.CreatePredictionService(AUTH_JSON_FILE); ProjectModelId projectModelId = new ProjectModelId(PROJECT_NUMBER, modelId); //ICommand command = new TrainingCommand(predictionFramework, projectModelId, storageData); //ICommand command = new StatusCommand(predictionFramework, projectModelId); //ICommand command = new AnalysisCommand(predictionFramework, projectModelId); ICommand command = new PredictCommand(predictionFramework, projectModelId, predictFile); Console.WriteLine("Project number: {0}, Model ID: {1}", projectModelId.ProjectNumber, projectModelId.ModelId); Console.WriteLine("Command: {0}", command.Command); command.Run(); }
public Insert2 GetModelStatus(ProjectModelId projectModelId) { var getRequest = PredictionService.Trainedmodels.Get(projectModelId.ProjectNumber, projectModelId.ModelId); Insert2 response = getRequest.Execute(); return response; }
public string DeleteTrainedModel(ProjectModelId projectModelId) { var deleteRequest = PredictionService.Trainedmodels.Delete(projectModelId.ProjectNumber, projectModelId.ModelId); string deleteResponse = deleteRequest.Execute(); return deleteResponse; }