Este repositorio contiene un proyecto de prueba de concepto para Azure Machine Learning Studio Management.
La solución incluye las bibliotecas de clases .NET Standard 2.0 ( DLL ), que se pueden incorporar en muchas aplicaciones .NET y usarse para escala y automatizar los espacios y experimentos de Azure ML Studio.
En este momento, el proyecto está en la fase de prelanzamiento: ¡tenga en cuenta los posibles errores y excepciones antes de usarlo!
La idea de crear una herramienta para administrar Azure Machine Learning Studio nació durante la reunión con nuestro socio Soneta/ENOVA365 .
Nuestro socio estaba buscando soluciones que pudieran ayudar a automatizar y escalar experimentos en Azure ML Studio Portal. Después del análisis inicial de las herramientas disponibles, descubrí el único que utilicé más tarde como base para la solución actual ( Fuente: Módulo PowerShell para Azure Machine Learning Studio & Web Services ): esta solución se desarrolló para los usuarios de PowerShell, y la implementación del código C# (SDK) me ayudó como una base para crear este proyecto.
Esta solución se creó para el uso de recursos de estudio de aprendizaje automático de Azure: espacio de trabajo, experimento, base de datos, módulos, etc. Necesitamos una cuenta adecuada para poder trabajar utilizando esta biblioteca.
Podemos crear diferentes tipos de espacios de trabajo, porque nuestra biblioteca debe tratar cualquier tipo de cuenta.
Visite el sitio web principal de Azure Machine Learning Studio y simplemente cree una nueva cuenta: https://studio.azureml.net/
Deberías notar esto:

Alternativamente, cree una cuenta de Azure con una suscripción.
Y crear un espacio de trabajo con el portal:




Azureml.studio.dll y Azureml.studio.core.dll son bibliotecas de clase escritas en .NET Standard 2.0.
"El estándar .NET es una especificación formal de las API .NET que están destinadas a estar disponibles en todas las implementaciones de .NET. La motivación detrás del estándar .NET está estableciendo una mayor uniformidad en el ecosistema .NET. ECMA 335 continúa estableciendo uniformidad para el comportamiento de implementación de .NET, pero no hay una especificación similar para las bibliotecas de clase de .NET (BCL) para .NET Biblioteca.
Puede usar estas DLL en PartLuar, sin embargo, antes de usar Concider la siguiente tabla de todas las versiones de .NET Standard y las plataformas admitidas ( Fuente: .NET Standard ):
| .NET estándar | 1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 2.0 |
|---|---|---|---|---|---|---|---|---|
| .NET núcleo | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 2.0 |
| Marco .net | 4.5 | 4.5 | 4.5.1 | 4.6 | 4.6.1 | 4.6.1 | 4.6.1 | 4.6.1 |
| Mononucleosis infecciosa | 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 |
| Plataforma de Windows universal | 10.0 | 10.0 | 10.0 | 10.0 | 10.0 | 10.0.16299 | 10.0.16299 | 10.0.16299 |
Es posible que necesite herramientas como editores de código, IDE o blocs de notas, y bibliotecas a través de las cuales puede crear una aplicación .NET. En ese caso, utilicé Visual Studio con marcos adecuados para ejecutar una aplicación de consola como ejemplo.
( De la fuente: https://github.com/hning86/azuremlps#configuration ):
ID de espacio de trabajo

Token de autorización del espacio de trabajo

Ubicación


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" ) ;Faltan muchas líneas de código, sin embargo, en este estado podrá realizar muchas operaciones básicas.
Hay un proyecto de prueba unitario incluido, pero está vacío y se terminará en la próxima iterración del desarrollo. Hasta ahora he probado algunas operaciones importantes en la aplicación de la consola.
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" ) ;
}Así se veía desde la vista del portal:






Modificar el valor del parámetro de nodo de un experimento y sobrescribir el experimento:
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" ) ;
}Modifique el valor del parámetro de nodo de un experimento y el ahorro como un nuevo experimento:
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" ) ;
}Desde la vista del portal:




Modifique la conexión dentro de los módulos (nodos) y sobrescribe el experimento:
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" ) ;
}Modifique la conexión dentro de los módulos (nodos) y el ahorro como un nuevo experimento:
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 desde la vista del portal:





Agregar un nuevo módulo al experimento y sobrescribirlo:
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 ) ;
}Agregar un nuevo módulo al experimento y guardar como nuevo:
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" ) ;
}Código fuente del sitio web y la vista del portal:


Hay muchos pensamientos que he tenido durante la codificación de esta solución. Sobre todo, era difícil ser consistente con respecto a los métodos de nombres, clases o incluso describir resúmenes de cada instancia. Traté de asegurarme de que el código que he estado creando no sería uno de los espagueti. La solución aún está en desarrollo, ¡y se necesita soporte continuo! Seguramente la refactorización es imprescindible en muchos aspectos y se deben implementar pocos principios. Además, pocos métodos siguen siendo un misterio para mí, y los dejé en el SDK ( Managementservice.cs ), ¡necesitas encontrarlos!
Además, encontré varios errores del portal mismo. Estos errores están ocultos en algún lugar de esas operaciones de copia/ahorro.
Como escribí en la mendicidad: es una versión previa a la liberación que contiene muchos errores y excepciones no manejadas (la implementación de estas está en mi lista de TODO). ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
Siéntase libre de contribuir, bifurcarse, modificar, cooperar. Espero que esta biblioteca sea útil.