Dieses Repository enthält ein Proof -of -Concept -Projekt für das Azure Machine Learning Studio Management.
Die Lösung umfasst .NET Standard 2.0 -Klassenbibliotheken ( DLLs ), die in vielen .NET -Anwendungen integriert werden können und für die Skalierung und Automatisierung von Azure ML Studio Workspaces und Experimenten verwendet werden.
Derzeit befindet sich das Projekt in der Phase vor der Veröffentlichung - Beachten Sie mögliche Fehler und Ausnahmen, bevor Sie es verwenden!
Die Idee, ein Tool zur Verwaltung von Azure Machine Learning Studio zu erstellen, wurde während des Treffens mit unserem Partner Soneta/Enova365 geboren.
Unser Partner suchte nach Lösungen, mit denen Experimente im Azure ML Studio Portal automatisiert und skaliert werden konnten. Nach der ersten Analyse der verfügbaren Tools entdeckte ich die einzige, die ich später als Basis für die aktuelle Lösung verwendet habe ( Quelle: PowerShell -Modul für Azure Machine Learning Studio & Web Services ). Diese Lösung wurde für PowerShell -Benutzer entwickelt, und die C# Code -Implementierung (SDK) half mir als Basis, um dieses Projekt zu erstellen.
Diese Lösung wurde für die Verwendung von Azure Machine Learning Studio Resources erstellt - Arbeitsbereich, Experiment, Datenbank, Module usw. Wir benötigen ein ordnungsgemäßes Konto, um mit dieser Bibliothek zu arbeiten.
Wir können verschiedene Arten von Arbeitsbereichen erstellen, da unsere Bibliothek mit jeder Art von Konto umgehen sollte.
Besuchen Sie die Hauptwebsite von Azure Machine Learning Studio und erstellen Sie einfach ein neues Konto - https://studio.azureml.net/
Sie sollten Folgendes bemerken:

Erstellen Sie alternativ ein Azure -Konto mit einem Abonnement.
Und erstellen Sie einen Arbeitsbereich mit dem Portal:




Azureml.studio.dll und azureml.studio.core.dll sind Klassenbibliotheken, die in .NET Standard 2.0 geschrieben wurden.
"Der .NET -Standard ist eine formale Spezifikation von .NET -APIs, die für alle .NET -Implementierungen verfügbar sein sollen. Die Motivation hinter dem .NET -Standard besteht darin, eine stärkere Einheitlichkeit im .NET -Ökosystem festzulegen. ECMA 335 legt weiterhin Einheitlichkeiten für .NET -Implementierungsverhalten fest, aber es gibt keine ähnlichen Spezialitäten für die .NET -Basisklassen -Bibliotheken (BCL) für .NET -Bibliothek -Implementierungen."
Sie können diese DLLs in Partluar verwenden. Bevor Sie jedoch die folgende Tabelle aller Versionen von .NET Standard und den unterstützten Plattformen verwenden ( Quelle: .NET Standard ):
| .NET Standard | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 2.0 |
|---|---|---|---|---|---|---|---|---|
| .NET CORE | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 2.0 |
| .NET Framework | 4.5 | 4.5 | 4.5.1 | 4.6 | 4.6.1 | 4.6.1 | 4.6.1 | 4.6.1 |
| Mono | 4.6 | 4.6 | 4.6 | 4.6 | 4.6 | 4.6 | 4.6 | 5.4 |
| Xamarin.ios | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.14 |
| Xamarin.Mac | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.8 |
| Xamarin.android | 7.0 | 7.0 | 7.0 | 7.0 | 7.0 | 7.0 | 7.0 | 8.0 |
| Universelle Windows -Plattform | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0.16299 | 10.0.16299 | 10.0.16299 |
Möglicherweise benötigen Sie Tools wie Code-Editoren, IDES oder Notizbilder sowie Bibliotheken, über die Sie eine .NET-Anwendung erstellen können. In diesem Fall habe ich Visual Studio mit geeigneten Frameworks verwendet, um eine Konsolenanwendung als Beispiel auszuführen.
( Aus Quelle: https://github.com/Hning86/azuremlps#configuration ):
Arbeitsbereich ID

Workspace Authorization Token

Standort


using AzureML . Studio . Core . Models ;
namespace AzureML . Studio . ConsoleApplicationExample
{
class Program
{
static void Main ( string [ ] args )
{
var studioClient = new StudioClient ( ) ;
var workspaceSettings = WorkspaceSettings ( ) ;
workspaceSettings . WorkspaceId = "XYZ" ;
workspaceSettings . AuthorizationToken = "######" ;
workspaceSettings . Location = "" ;
var workspace = studioClient . GetWorkspace ( workspaceSettings ) ;
.. .
.. .
} var workspace = studioClient . GetWorkspace ( workspaceSettings ) ; var workspace = studioClient . GetWorkspace ( "XYZ" , "######" , "" ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaces = studioClient . GetWorkspaces ( workspacesSettings ) ; var users = studioClient . GetWorkspaceUsers ( workspaceSettings ) ; var users = studioClient . GetWorkspaceUsers ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var users = studioClient . GetWorkspaceUsers ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUsersdictionary = studioClient . GetWorkspacesUsers ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceUsersdictionary = studioClient . GetWorkspacesUsers ( workspaces ) ; var workspaceUser = new WorkspaceUser (
new WorkspaceUserInternal ( ) {
User = new UserDetailInternal ( ) {
Email = "email" , Role = "role" } } ) ) ;
studioClient . AddUserToWorkspace ( workspaceSettings , workspaceUser ) ; studioClient . AddUserToWorkspace ( workspaceSettings , "email" , "role" ) ; studioClient . AddUserToWorkspace ( "XYZ" , "######" , "" , workspaceUser ) ; studioClient . AddUserToWorkspace ( "XYZ" , "######" , "" , "email" , "role" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . AddUserToWorkspace ( workspace , workspaceUser ) ; studioClient . AddUserToWorkspace ( workspace , "email" , "role" ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUser = new WorkspaceUser (
new WorkspaceUserInternal ( ) {
User = new UserDetailInternal ( ) {
Email = "email" , Role = "role" } } ) ) ;
studioClient . AddUserToWorkspaces ( workspacesSettings , workspaceUser ) ; studioClient . AddUserToWorkspaces ( workspacesSettings , "email" , "role" ) ; IEnumerable < Workspace > workspaces ;
studioClient . AddUserToWorkspaces ( workspaces , workspaceUser ) ; studioClient . AddUserToWorkspaces ( workspaces , "email" , "role" ) ; IEnumerable < WorkspaceUser > workspaceUsers ;
studioClient . AddUsersToWorkspace ( workspaceSettings , workspaceUsers ) ; studioClient . AddUsersToWorkspace ( "XYZ" , "######" , "" , workspaceUsers ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . AddUsersToWorkspace ( workspace , workspaceUsers ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
IEnumerable < WorkspaceUser > workspaceUsers ;
studioClient . AddUsersToWorkspaces ( workspacesSettings , workspaceUsers ) ; IEnumerable < Workspace > workspaces ;
studioClient . AddUsersToWorkspaces ( workspaces , workspaceUsers ) ; var datasets = studioClient . GetDatasetsFromWorkspace ( workspaceSettings ) ; var datasets = studioClient . GetDatasetsFromWorkspace ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var datasets = studioClient . GetDatasetsFromWorkspace ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceDatasetsDictionary = studioClient . GetDatasetsFromWorkspaces ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceDatasetsDictionary = studioClient . GetDatasetsFromWorkspaces ( workspaces ) ; studioClient . DeleteDatasetFromWorkspace ( workspaceSettings , "datasetFamilyId" ) ; var dataset = new Dataset ( ) ;
dataset . FamilyId = "datasetFamilyId" ;
studioClient . DeleteDatasetFromWorkspace ( workspaceSettings , dataset ) ; studioClient . DeleteDatasetFromWorkspace ( "XYZ" , "######" , "" , dataset ) ; studioClient . DeleteDatasetFromWorkspace ( "XYZ" , "######" , "" , "datasetFamilyId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteDatasetFromWorkspace ( workspace , "datasetFamilyId" ) studioClient . DeleteDatasetFromWorkspace ( workspace , dataset ) ; IEnumerable < Dataset > datasets ;
studioClient . DeleteDatasetsFromWorkspace ( workspaceSettings , datasets ) ; studioClient . DeleteDatasetsFromWorkspace ( "XYZ" , "######" , "" , datasets ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteDatasetsFromWorkspace ( workspace , datasets ) ; studioClient . DeleteAllDatasetsFromWorkspace ( workspaceSettings ) ; studioClient . DeleteAllDatasetsFromWorkspace ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteAllDatasetsFromWorkspace ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . DeleteAllDatasetsFromWorkspaces ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . DeleteAllDatasetsFromWorkspaces ( workspaces ) ; studioClient . DownloadDatasetFromWorkspace ( workspaceSettings , "datasetId" , "fileName" ) ; studioClient . DownloadDatasetFromWorkspace ( "XYZ" , "######" , "" , "datasetId" , "fileName" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DownloadDatasetFromWorkspace ( workspace , "datasetId" , "fileName" ) ; var dataset = new Dataset ( ) ;
dataset . Id = "datasetId" ;
studioClient . DownloadDatasetFromWorkspace ( workspaceSettings , dataset , "fileName" ) ; studioClient . DownloadDatasetFromWorkspace ( "XYZ" , "######" , "" , dataset , "fileName" ) ; studioClient . DownloadDatasetFromWorkspace ( workspace , dataset , "fileName" ) ; IEnumerable < Dataset > datasets ;
studioClient . DownloadDatasetsFromWorkspace ( workspaceSettings , datasets ) ; studioClient . DownloadDatasetsFromWorkspace ( "XYZ" , "######" , "" , datasets ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DownloadDatasetsFromWorkspace ( workspace , datasets ) ; studioClient . DownloadAllDatasetsFromWorkspace ( workspaceSettings ) ; studioClient . DownloadAllDatasetsFromWorkspace ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DownloadAllDatasetsFromWorkspace ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . DownloadAllDatasetsFromWorkspaces ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . DownloadAllDatasetsFromWorkspaces ( workspaces ) ; Enum: ResourceFileformat.cs
ResourceFileFormat resourceFileFormat ;
async studioClient . UploadResourceToWorkspace ( workspaceSettings , resourceFileFormat , " filePath " ) ; async studioClient . UploadResourceToWorkspace ( "XYZ" , "######" , "" , resourceFileFormat , "filePath" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
async studioClient . UploadResourceToWorkspace ( workspace , resourceFileFormat , " filePath " ) ; Enum: ResourceFileformat.cs
IDictionary < string , ResourceFileFormat > filePathResourceFileFormatDict ;
studioClient . UploadResourcesToWorkspace ( workspaceSettings , filePathResourceFileFormatDict ) ; studioClient . UploadResourcesToWorkspace ( "XYZ" , "######" , "" , filePathResourceFileFormatDict ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . UploadResourcesToWorkspace ( workspace , filePathResourceFileFormatDict ) ; Enum: ResourceFileformat.cs
IEnumerable < WorkspaceSettings > workspacesSettings ;
ResourceFileFormat resourceFileFormat ;
studioClient . UploadResourceToWorkspaces ( workspacesSettings , resourceFileFormat , "filePath" ) ; IEnumerable < Workspace > workspaces ;
studioClient . UploadResourceToWorkspaces ( workspaces , resourceFileFormat , "filePath" ) ; Enum: ResourceFileformat.cs
IEnumerable < WorkspaceSettings > workspacesSettings ;
IDictionary < string , ResourceFileFormat > filePathResourceFileFormatDict ;
studioClient . UploadResourcesToWorkspaces ( workspacesSettings , filePathResourceFileFormatDict ) ; IEnumerable < Workspace > workspaces ;
studioClient . UploadResourcesToWorkspaces ( workspaces , filePathResourceFileFormatDict ) ; var experiment = studioClient . GetExperiment ( workspaceSettings , "experimentId" ) ; var experiment = studioClient . GetExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var experiment = studioClient . GetExperiment ( workspace , "experimentId" ) ; IEnumerable < string > experimentsIds ;
var experiments = studioClient . GetExperiments ( workspaceSettings , experimentsIds ) ; var experiments = studioClient . GetExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var experiments = studioClient . GetExperiments ( workspace , experimentsIds ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceExperimentsDict = studioClient . GetAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceExperimentsDict = studioClient . GetAllExperiments ( workspaces ) ; var experiments = studioClient . GetAllExperiments ( workspaceSettings ) ; var experiments = studioClient . GetAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var experiments = studioClient . GetAllExperiments ( workspace ) ; studioClient . RunExperiment ( workspaceSettings , "experimentId" ) ; studioClient . RunExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . RunExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . RunExperiment ( workspaceSettings , experiment ) ; studioClient . RunExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . RunExperiment ( workspace , experiment ) ; IEnumerable < string > experimentsIds ;
studioClient . RunExperiments ( workspaceSettings , experimentsIds ) ; studioClient . RunExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . RunExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . RunExperiments ( workspaceSettings , experiments ) ; studioClient . RunExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . RunExperiments ( workspace , experiments ) ; studioClient . RunAllExperiments ( workspaceSettings ) ; studioClient . RunAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . RunAllExperiments ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . RunAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . RunAllExperiments ( workspaces ) ; studioClient . SaveExperiment ( workspaceSettings , "experimentId" ) ; studioClient . SaveExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . SaveExperiment ( workspaceSettings , experiment ) ; studioClient . SaveExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . SaveExperiment ( workspace , experiment ) ; IEnumerable < string > experimentsIds ;
studioClient . SaveExperiments ( workspaceSettings , experimentsIds ) ; studioClient . SaveExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . SaveExperiments ( workspaceSettings , experiments ) ; studioClient . SaveExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . SaveExperiments ( workspace , experiments ) ; studioClient . SaveAllExperiments ( workspaceSettings ) ; studioClient . SaveAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveAllExperiments ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . SaveAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . SaveAllExperiments ( workspaces ) ; studioClient . SaveExperimentAs ( workspaceSettings , "experimentId" , "newName" ) ; studioClient . SaveExperimentAs ( "XYZ" , "######" , "" , "experimentId" , "newName" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . SaveExperimentAs ( workspace , "experimentId" , "newName" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . SaveExperimentAs ( workspaceSettings , experiment , "newName" ) ; studioClient . SaveExperimentAs ( "XYZ" , "######" , "" , experiment , "newName" ) ; studioClient . SaveExperimentAs ( workspace , experiment , "newName" ) ; studioClient . DeleteExperiment ( workspaceSettings , "experimentId" ) ; studioClient . DeleteExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . DeleteExperiment ( workspaceSettings , experiment ) ; studioClient . DeleteExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . DeleteExperiment ( workspace , experiment ) ; IEnumerable < string > experimentsIds ;
studioClient . DeleteExperiments ( workspaceSettings , experimentsIds ) ; studioClient . DeleteExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . DeleteExperiments ( workspaceSettings , experiments ) ; studioClient . DeleteExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . DeleteExperiments ( workspace , experiments ) ; studioClient . DeleteAllExperiments ( workspaceSettings ) ; studioClient . DeleteAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . DeleteAllExperiments ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . DeleteAllExperiments ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
studioClient . DeleteAllExperiments ( workspaces ) ; studioClient . ExportExperiment ( workspaceSettings , "experimentId" ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , "experimentId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ExportExperiment ( workspace , "experimentId" ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . ExportExperiment ( workspaceSettings , experiment ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , experiment ) ; studioClient . ExportExperiment ( workspace , experiment ) ; studioClient . ExportExperiment ( workspaceSettings , "experimentId" , "outputFilePath" ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , "experimentId" , "outputFilePath" ) ; studioClient . ExportExperiment ( workspace , "experimentId" , "outputFilePath" ) ; studioClient . ExportExperiment ( workspaceSettings , experiment , "outputFilePath" ) ; studioClient . ExportExperiment ( "XYZ" , "######" , "" , experiment , "outputFilePath" ) ; studioClient . ExportExperiment ( workspace , experiment , "outputFilePath" ) ; IEnumerable < string > experimentsIds ;
studioClient . ExportExperiments ( workspaceSettings , experimentsIds ) ; studioClient . ExportExperiments ( "XYZ" , "######" , "" , experimentsIds ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ExportExperiments ( workspace , experimentsIds ) ; IEnumerable < Experiment > experiments ;
studioClient . ExportExperiments ( workspaceSettings , experiments ) ; studioClient . ExportExperiments ( "XYZ" , "######" , "" , experiments ) ; studioClient . ExportExperiments ( workspace , experiments ) ; studioClient . ExportAllExperiments ( workspaceSettings ) ; studioClient . ExportAllExperiments ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ExportAllExperiments ( workspace ) ; studioClient . ImportExperiment ( workspaceSettings , "inputFilePath" ) ; studioClient . ImportExperiment ( "XYZ" , "######" , "" , "inputFilePath" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ImportExperiment ( workspace , "inputFilePath" ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
studioClient . ImportExperiment ( workspacesSettings , "inputFilePath" ) ; IEnumerable < Workspace > workspaces ;
studioClient . ImportExperiment ( workspaces , "inputFilePath" ) ; studioClient . ImportExperiment ( workspaceSettings , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( "XYZ" , "######" , "" , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( workspace , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( workspacesSettings , "inputFilePath" , "newName" ) ; studioClient . ImportExperiment ( workspaces , "inputFilePath" , "newName" ) ; studioClient . CopyExperiment ( sourceWorkspaceSettings , "experimentId" , destinationWorkspaceSettings ) ; var experiment = new Experiment ;
experiment . ExperimentId = "experimentId" ;
studioClient . CopyExperiment ( sourceWorkspaceSettings , experiment , destinationWorkspaceSettings ) ; IEnumerable < string > experimentsIds ;
studioClient . CopyExperiments ( sourceWorkspaceSettings , experimentsIds , destinationWorkspaceSettings ) ; IEnumerable < Experiment > experiments ;
studioClient . CopyExperiments ( sourceWorkspaceSettings , experiments , destinationWorkspaceSettings ) ; studioClient . CopyAllExperiments ( sourceWorkspaceSettings , destinationWorkspaceSettings ) ; var userAsset = studioClient . GetTrainedModel ( workspaceSettings , "userAssetId" ) ; var userAsset = studioClient . GetTrainedModel ( "XYZ" , "######" , "" , "userAssetId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAsset = studioClient . GetTrainedModel ( workspace , "userAssetId" ) ; var userAssets = studioClient . GetTrainedModels ( workspaceSettings ) ; var userAssets = studioClient . GetTrainedModels ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAssets = studioClient . GetTrainedModels ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUserAssetsDict = studioClient . GetTrainedModels ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceUserAssetsDict = studioClient . GetTrainedModels ( workspaces ) ; var userAsset = studioClient . GetTransform ( workspaceSettings , "userAssetId" ) ; var userAsset = studioClient . GetTransform ( "XYZ" , "######" , "" , "userAssetId" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAsset = studioClient . GetTransform ( workspace , "userAssetId" ) ; var userAssets = studioClient . GetTransforms ( workspaceSettings ) ; var userAssets = studioClient . GetTransforms ( "XYZ" , "######" , "" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
var userAssets = studioClient . GetTransforms ( workspace ) ; IEnumerable < WorkspaceSettings > workspacesSettings ;
var workspaceUserAssetsDict = studioClient . GetTransforms ( workspacesSettings ) ; IEnumerable < Workspace > workspaces ;
var workspaceUserAssetsDict = studioClient . GetTransforms ( workspaces ) ; studioClient . ModifyNodeParameter ( workspaceSettings , "experimentId" , "nodeNameComment" , "nodeParameterName" , "value" , "saveAs" ) ; studioClient . ModifyNodeParameter ( "XYZ" , "######" , "" , "experimentId" , "nodeNameComment" , "nodeParameterName" , "value" , "saveAs" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ModifyNodeParameter ( workspace , "experimentId" , "nodeNameComment" , "nodeParameterName" , "value" , "saveAs" ) ; studioClient . ModifyNodeEdge ( workspaceSettings , "experimentId" , "sourceNodeComment" , "destinationNodeComment" , "saveAs" ) ; studioClient . ModifyNodeEdge ( "XYZ" , "######" , "" , "experimentId" , "sourceNodeComment" , "destinationNodeComment" , "saveAs" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . ModifyNodeEdge ( workspace , "experimentId" , "sourceNodeComment" , "destinationNodeComment" , "saveAs" ) ; studioClient . AddModule ( workspaceSettings , "experimentId" , "nameOfNewModule" , "saveAs" ) ; studioClient . AddModule ( "XYZ" , "######" , "" , "experimentId" , "nameOfNewModule" , "saveAs" ) ; var workspace = new Workspace ( ) ;
workspace . WorkspaceId = "XYZ" ;
workspace . AuthorizationToken . PrimaryToken = "######" ;
workspace . Region = "" ;
studioClient . AddModule ( workspace , "experimentId" , "nameOfNewModule" , "saveAs" ) ;Viele Codezeilen fehlen, in diesem Zustand können Sie jedoch viele grundlegende Operationen ausführen.
Es ist ein Unit -Testprojekt enthalten, aber es ist leer und wird in der nächsten Entwicklung der Entwicklung abgeschlossen. Bisher habe ich einige wichtige Vorgänge in der Konsolenanwendung getestet.
static void CopyExperimentFromWorkspaceToWorkspaceSamePricingSameRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . CopyExperiment ( sourceWorkspace , experiment , destinationWorkspace ) ;
} static void CopyExperimentFromWorkspaceToWorkspaceDifferentPricingSameRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . CopyExperiment ( sourceWorkspace , experiment , destinationWorkspace ) ;
} static void CopyExperimentFromWorkspaceToWorkspaceSamePricingDifferentRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . ExportExperiment ( sourceWorkspace , experiment ) ;
var inputFilePath = @"C:...experimentFileName" ;
studioClient . ImportExperiment ( destinationWorkspace , inputFilePath , "Copied from other region" ) ;
} static void CopyExperimentFromWorkspaceToWorkspaceDifferentPricingDifferentRegion ( StudioClient studioClient )
{
var sourceWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
var destinationWorkspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( sourceWorkspace , experimentId ) ;
studioClient . ExportExperiment ( sourceWorkspace , experiment ) ;
var inputFilePath = @"C:...experimentFileName" ;
studioClient . ImportExperiment ( destinationWorkspace , inputFilePath , "Copied from other region" ) ;
}So sah es aus der Ansicht des Portals aus:






Ändern Sie den Node -Parameterwert eines Experiments und überschreiben Sie das Experiment:
static void ModifyExperimentNodeAndOverwrite ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeParameter ( workspace , experimentId , "Import Data Comment" , "Database Query" , "SELECT Name, ProductNumber, CAST(Weight AS float) Weight r n FROM SalesLT.Product" ) ;
}Ändern Sie den Node -Parameterwert eines Experiments und sparen Sie als neues Experiment:
static void ModifyExperimentNodeAndSaveAsAnotherExperiment ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = "West Europe"
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeParameter ( workspace , experimentId , "Import Data Comment" , "Database Query" , "SELECT Name, Color, CAST(Weight AS float) Weight r n FROM SalesLT.Product" , "Import Data - Experiment 2" ) ;
}Aus der Ansicht des Portals:




Ändern Sie die Verbindung in den Modulen (Knoten) und überschreiben Sie das Experiment:
static void ModifyConnectionWithinTheModulesAndOverwrite ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeEdge ( workspace , experimentId , "CSV" , "Dataset" ) ;
}Ändern Sie die Verbindung in den Modulen (Knoten) und sparen Sie als neues Experiment:
static void ModifyConnectionWithinTheModulesAndSaveAsAnotherExperiment ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
studioClient . ModifyNodeEdge ( workspace , experimentId , "CSV" , "Dataset" , "Connect Modules - Experiment 2" ) ;
}Aaand aus der Ansicht des Portals:





Hinzufügen eines neuen Moduls zum Experiment und überschreiben Sie es:
static void AddModuleToTheExperimentAndOverwrite ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
var nameOfNewModule = "" ;
//nameOfNewModule hard-coded
//TODO: make a dictionary of <Module Names, Module IDs>
//EXAMPLES:
//Convert to TSV: 506153734175476c4f62416c57734963.1cdbcda42ece49088b87e6b636258d3d.v1-default-1644
//Convert to Dataset: 506153734175476c4f62416c57734963.72bf58e0fc874bb19704f1805003b975.v1-default-1642
studioClient . AddModule ( workspace , experimentId , nameOfNewModule ) ;
}Hinzufügen eines neuen Moduls zum Experiment und Speichern als neuer: Speichern:
static void AddModuleToTheExperimentAndSaveAsAnotherExperiment ( StudioClient studioClient )
{
var workspace = new WorkspaceSettings ( )
{
WorkspaceId = "" ,
AuthorizationToken = "" ,
Location = ""
} ;
//var experiments = studioClient.GetExperiments(sourceWorkspace);
var experimentId = "" ;
var experiment = studioClient . GetExperiment ( workspace , experimentId ) ;
var nameOfNewModule = "" ;
//nameOfNewModule hard-coded
//TODO: make a dictionary of <Module Names, Module IDs>
//EXAMPLES:
//Convert to TSV: 506153734175476c4f62416c57734963.1cdbcda42ece49088b87e6b636258d3d.v1-default-1644
//Convert to Dataset: 506153734175476c4f62416c57734963.72bf58e0fc874bb19704f1805003b975.v1-default-1642
studioClient . AddModule ( workspace , experimentId , nameOfNewModule , "Connect Modules - Experiment 2" ) ;
}Quellcode der Website und des Portals Ansicht:


Es gibt viele Gedanken, die ich während der Codierung dieser Lösung hatte. Vor allem war es schwierig, in Bezug auf Benennungsmethoden, Klassen oder sogar die Beschreibung der Zusammenfassungen jeder Instanz konsequent zu sein. Ich versuchte sicher zu sein, dass der Code, den ich erstellt habe, kein Spaghetti ist. Die Lösung ist noch in der Entwicklung und kontinuierliche Unterstützung ist erforderlich! Sicherlich ist das Refactoring in vielen Aspekten ein Muss, und es sollten nur wenige Grundsätze umgesetzt werden. Darüber hinaus sind nur wenige Methoden für mich immer noch ein Rätsel, und ich habe sie im SDK ( ManagementService.cs ) zurückgelassen - Sie müssen sie finden!
Darüber hinaus habe ich auf mehrere Fehler des Portals selbst gestoßen. Diese Fehler sind irgendwo in diesen Kopier-/Sparenvorgängen versteckt.
Wie ich beim Betteln schrieb, handelt es sich um eine Pre-Veröffentlichungsversion, die viele Fehler und nicht gehandelte Ausnahmen enthält (die Implementierung ist in meiner TODO-Liste). Sich bewusst sein !!!
Fühlen Sie sich frei, einen Beitrag zu leisten, zu gabelieren, zu ändern, zusammenzuarbeiten. Ich hoffe, diese Bibliothek wird hilfreich sein.