Documentation ¶
Index ¶
- Constants
- func BuildSchemaFileURI(uri string) string
- func ConvertDatasetTA3ToTA2(dataset string) string
- func ConvertMetricsFromTA3ToTA2(metrics []string, posLabel string) []*pipeline.ProblemPerformanceMetric
- func ConvertProblemMetricToTA2(metric string) string
- func ConvertProblemTaskToTA2(metric string) string
- func ConvertTargetFeaturesTA3ToTA2(target string, columnIndex int) []*pipeline.ProblemTarget
- func ConvertTaskKeywordsFromTA3ToTA2(taskKeywords []string) []string
- func GetAPIVersion() string
- func GetDefaultTaskMetricsTA3(taskKeywords []string) []string
- func GetMetricLabel(metric string) string
- func GetMetricScoreMultiplier(metric string) float64
- func PullFromAPI(maxPulls int, timeout time.Duration, pull PullFunc) error
- type Client
- func (c *Client) Close()
- func (c *Client) EndSearch(ctx context.Context, searchID string) error
- func (c *Client) ExecutePipeline(ctx context.Context, datasetURIs []string, ...) (*pipeline.PipelineExecuteResponse, error)
- func (c *Client) ExportSolution(ctx context.Context, solutionID string) error
- func (c *Client) GeneratePredictions(ctx context.Context, request *pipeline.ProduceSolutionRequest) (string, []*pipeline.GetProduceSolutionResultsResponse, error)
- func (c *Client) GenerateSolutionFit(ctx context.Context, request *pipeline.FitSolutionRequest) ([]*pipeline.GetFitSolutionResultsResponse, error)
- func (c *Client) GenerateSolutionScores(ctx context.Context, solutionID string, datasetURI string, metrics []string, ...) ([]*pipeline.GetScoreSolutionResultsResponse, error)
- func (c *Client) GetSolutionDescription(ctx context.Context, solutionID string) (*pipeline.DescribeSolutionResponse, error)
- func (c *Client) Hello() (string, error)
- func (c *Client) LoadFittedSolution(ctx context.Context, fittedSolutionURI string) (string, error)
- func (c *Client) LoadSolution(ctx context.Context, solutionURI string) (string, error)
- func (c *Client) SaveFittedSolution(ctx context.Context, fittedSolutionID string) (string, error)
- func (c *Client) SaveSolution(ctx context.Context, solutionID string) (string, error)
- func (c *Client) SearchSolutions(ctx context.Context, searchID string, solutionHandler SearchSolutionHandler) error
- func (c *Client) StartSearch(ctx context.Context, request *pipeline.SearchSolutionsRequest) (string, error)
- func (c *Client) StopSearch(ctx context.Context, searchID string) error
- type ExecPipelineRequest
- type ExecPipelineStatus
- type ExecPipelineStatusListener
- type PullFunc
- type SearchSolutionHandler
Constants ¶
const ( // DefaultResourceID is the default name of the main resource id in a schema. DefaultResourceID = "learningData" // DefaultExposedOutputKey is the standard output key applied to pipelines. DefaultExposedOutputKey = "outputs.0" // SolutionPendingStatus represents that the solution request has been acknoledged by not yet sent to the API SolutionPendingStatus = "SOLUTION_PENDING" // SolutionFittingStatus represents that the solution request has been sent to the API. SolutionFittingStatus = "SOLUTION_FITTING" // SolutionScoringStatus represents that the solution request has been sent to the API. SolutionScoringStatus = "SOLUTION_SCORING" // SolutionProducingStatus represents that the solution request has been sent to the API. SolutionProducingStatus = "SOLUTION_PRODUCING" // SolutionErroredStatus represents that the solution request has terminated with an error. SolutionErroredStatus = "SOLUTION_ERRORED" // SolutionCompletedStatus represents that the solution request has completed successfully. SolutionCompletedStatus = "SOLUTION_COMPLETED" // SolutionCancelledStatus represents that the solution request was intentionally cancelled. SolutionCancelledStatus = "SOLUTION_CANCELLED" // RequestPendingStatus represents that the solution request has been acknoledged by not yet sent to the API RequestPendingStatus = "REQUEST_PENDING" // RequestRunningStatus represents that the solution request has been sent to the API. RequestRunningStatus = "REQUEST_RUNNING" // RequestErroredStatus represents that the solution request has terminated with an error. RequestErroredStatus = "REQUEST_ERRORED" // RequestCompletedStatus represents that the solution request has completed successfully. RequestCompletedStatus = "REQUEST_COMPLETED" // D3MLearningData provides the name of the training csv file as defined in the D3M schema D3MLearningData = "learningData.csv" // DistilParquetLearningData provides the name of the training parquet file introduced by Distil DistilParquetLearningData = "learningData.parquet" // D3MDataFolder provides the name of the directory containing the dataset D3MDataFolder = "tables" // D3MDataSchema provides the name of the D3M data schema file D3MDataSchema = "datasetDoc.json" // D3MDatasetSchemaVersion is the current version supported when persisting D3MDatasetSchemaVersion = "3.0" // D3MResourceType is the resource type of persisted datasets D3MResourceType = "table" // D3MResourceFormat is the resource format of persisted dataset D3MResourceFormat = "text/csv" // DistilParquetResourceFormat is the parquet resource format of persisted dataset introduced by Distil DistilParquetResourceFormat = "application/parquet" )
const ( // ForecastingTask represents timeseries forcasting ForecastingTask = "forecasting" // ClassificationTask represents a classification task on image, timeseries or basic tabular data ClassificationTask = "classification" // RegressionTask represents a regression task on image, timeseries or basic tabular data RegressionTask = "regression" // ClusteringTask represents an unsupervised clustering task on image, timeseries or basic tabular data ClusteringTask = "clustering" // LinkPredictionTask represents a link prediction task on graph data LinkPredictionTask = "linkPrediction" // VertexClassificationTask represents a vertex nomination task on graph data VertexClassificationTask = "vertexClassification" // VertexNominationTask represents a vertex nomination task on graph data VertexNominationTask = "vertexNomination" // CommunityDetectionTask represents an unsupervised community detectiontask on on graph data CommunityDetectionTask = "communityDetection" // GraphMatchingTask represents an unsupervised matching task on graph data GraphMatchingTask = "graphMatching" // CollaborativeFilteringTask represents a collaborative filtering recommendation task on basic tabular data CollaborativeFilteringTask = "collaborativeFiltering" // ObjectDetectionTask represents an object detection task on image data ObjectDetectionTask = "objectDetection" // SemiSupervisedTask represents a semi-supervised classification task on tabular data SemiSupervisedTask = "semiSupervised" // BinaryTask represents task involving a single binary value for each prediction BinaryTask = "binary" // MultiClassTask represents a task involving a multi class value for each prediction MultiClassTask = "multiClass" // MultiLabelTask represents a task involving multiple lables for each each prediction MultiLabelTask = "multiLabel" // UnivariateTask represents a task involving predictions on a single variable UnivariateTask = "univariate" // MultivariateTask represents a task involving predictions on multiple variables MultivariateTask = "multivariate" // OverlappingTask represents a task involving overlapping predictions OverlappingTask = "overlapping" // NonOverlappingTask represents a task involving non-overlapping predictions NonOverlappingTask = "nonOverlapping" // TabularTask represents a task involving tabular data TabularTask = "tabular" // RelationalTask represents a task involving relational data RelationalTask = "relational" // ImageTask represents a task involving image data ImageTask = "image" // AudioTask represents a task involving audio data AudioTask = "audio" // VideoTask represents a task involving video data VideoTask = "video" // SpeechTask represents a task involving speech data SpeechTask = "speech" // TextTask represents a task involving text data TextTask = "text" // GraphTask represents a task involving graph data GraphTask = "graph" // MultiGraphTask represents a task involving multiple graph data MultiGraphTask = "multigraph" // TimeSeriesTask represents a task involving timeseries data TimeSeriesTask = "timeseries" // GroupedTask represents a task involving grouped data GroupedTask = "grouped" // GeospatialTask represents a task involving geospatial data GeospatialTask = "geospatial" // RemoteSensingTask represents a task involving remote sensing data RemoteSensingTask = "remoteSensing" // LupiTask represents a task involving LUPI (Learning Using Priveleged Information) data LupiTask = "lupi" // UndefinedTask is a flag for undefined/unknown task values UndefinedTask = "undefined" // UndefinedMetric is a flag for undefined/uknown metric values UndefinedMetric = "undefined" // CSVURIValueType denotes a CSV file URI at the TA2 level CSVURIValueType = "CSV_URI" // DatasetURIValueType denotes a D3M dataset file URI at the TA2 level DatasetURIValueType = "DATASET_URI" // ParquetURIValueType denotes a parquet file URI at the TA2 level ParquetURIValueType = "PARQUET_URI" // RawValueType denotes a raw numeric value RawValueType = "RAW" // HoldoutEvaluationMethod indicates a hold out model evaluation at the TA2 level HoldoutEvaluationMethod = "HOLDOUT" )
Variables ¶
This section is empty.
Functions ¶
func BuildSchemaFileURI ¶
BuildSchemaFileURI updates a URI to match the expected structure of a the TA2TA3 API.
func ConvertDatasetTA3ToTA2 ¶
ConvertDatasetTA3ToTA2 converts a dataset name from TA3 to TA2.
func ConvertMetricsFromTA3ToTA2 ¶
func ConvertMetricsFromTA3ToTA2(metrics []string, posLabel string) []*pipeline.ProblemPerformanceMetric
ConvertMetricsFromTA3ToTA2 converts metrics from TA3 to TA2 values.
func ConvertProblemMetricToTA2 ¶
ConvertProblemMetricToTA2 converts a problem schema metric to a TA2 metric.
func ConvertProblemTaskToTA2 ¶
ConvertProblemTaskToTA2 converts a problem schema metric to a TA2 task.
func ConvertTargetFeaturesTA3ToTA2 ¶
func ConvertTargetFeaturesTA3ToTA2(target string, columnIndex int) []*pipeline.ProblemTarget
ConvertTargetFeaturesTA3ToTA2 creates a problem target from a target name.
func ConvertTaskKeywordsFromTA3ToTA2 ¶
ConvertTaskKeywordsFromTA3ToTA2 converts a task from TA3 to TA2.
func GetAPIVersion ¶
func GetAPIVersion() string
GetAPIVersion retrieves the ta3-ta2 API version embedded in the pipeline_core.proto file. This is a non-trivial operation, so the value is cached for quick access.
func GetDefaultTaskMetricsTA3 ¶
GetDefaultTaskMetricsTA3 returns the default TA3 metrics for a supplied list of TA3 task keywords.
func GetMetricLabel ¶
GetMetricLabel returns a label string for a metric.
func GetMetricScoreMultiplier ¶
GetMetricScoreMultiplier returns a weight to determine whether a higher or lower score is `better`.
Types ¶
type Client ¶
type Client struct { UserAgent string PullTimeout time.Duration PullMax int SkipPreprocessing bool // contains filtered or unexported fields }
Client provides facilities for managing GPRC solution requests. Requests are isssued and a context object containing rx channels is returned to the caller for consumption of results. The context for running requests can also be fetched, along with their buffered results. Spawning a grpc.ClientConn per RPC call is not considered good practice - the system is designed such that multiple go routines make RPC calls to a single shared client, and synch is managed internally.
func NewClient ¶
func NewClient(serverAddr string, trace bool, userAgent string, label string, pullTimeout time.Duration, pullMax int, skipPreprocessing bool, logger middleware.MethodLogger) (*Client, error)
NewClient creates a new pipline request dispatcher instance. This will establish the connection to the solution server or return an error on fail
func (*Client) ExecutePipeline ¶
func (c *Client) ExecutePipeline(ctx context.Context, datasetURIs []string, pipelineDesc *pipeline.PipelineDescription) (*pipeline.PipelineExecuteResponse, error)
ExecutePipeline executes a pre-specified pipeline.
func (*Client) ExportSolution ¶
ExportSolution exports the solution.
func (*Client) GeneratePredictions ¶
func (c *Client) GeneratePredictions(ctx context.Context, request *pipeline.ProduceSolutionRequest) (string, []*pipeline.GetProduceSolutionResultsResponse, error)
GeneratePredictions generates predictions.
func (*Client) GenerateSolutionFit ¶
func (c *Client) GenerateSolutionFit(ctx context.Context, request *pipeline.FitSolutionRequest) ([]*pipeline.GetFitSolutionResultsResponse, error)
GenerateSolutionFit generates fit for candidate solutions.
func (*Client) GenerateSolutionScores ¶
func (c *Client) GenerateSolutionScores(ctx context.Context, solutionID string, datasetURI string, metrics []string, posLabel string) ([]*pipeline.GetScoreSolutionResultsResponse, error)
GenerateSolutionScores generates scrores for candidate solutions.
func (*Client) GetSolutionDescription ¶
func (c *Client) GetSolutionDescription(ctx context.Context, solutionID string) (*pipeline.DescribeSolutionResponse, error)
GetSolutionDescription gets the solution description via API call.
func (*Client) LoadFittedSolution ¶
LoadFittedSolution will have the server load a fitted solution by URI.
func (*Client) LoadSolution ¶
LoadSolution will have the server load a solution by URI.
func (*Client) SaveFittedSolution ¶
SaveFittedSolution saves the fitted solution.
func (*Client) SaveSolution ¶
SaveSolution saves the solution.
func (*Client) SearchSolutions ¶
func (c *Client) SearchSolutions(ctx context.Context, searchID string, solutionHandler SearchSolutionHandler) error
SearchSolutions generates candidate pipelines and executes a provided handler for each result. While handlers are executing asynchronously, this method will not return until all handlers have finished.
func (*Client) StartSearch ¶
func (c *Client) StartSearch(ctx context.Context, request *pipeline.SearchSolutionsRequest) (string, error)
StartSearch starts a solution search session.
type ExecPipelineRequest ¶
type ExecPipelineRequest struct {
// contains filtered or unexported fields
}
ExecPipelineRequest defines a request that will execute a fully specified pipline on a TA2 system.
func NewExecPipelineRequest ¶
func NewExecPipelineRequest(datasetURIs []string, datasetURIsProduce []string, pipelineDesc *pipeline.PipelineDescription) *ExecPipelineRequest
NewExecPipelineRequest creates a new request that will run the supplied dataset through the pipeline description.
func (*ExecPipelineRequest) Dispatch ¶
func (e *ExecPipelineRequest) Dispatch(client *Client, templateRequest *pipeline.SearchSolutionsRequest, allowedValueTypes []string) error
Dispatch dispatches a pipeline execute request for processing by TA2.
func (*ExecPipelineRequest) Listen ¶
func (e *ExecPipelineRequest) Listen(listener ExecPipelineStatusListener) error
Listen listens for new solution statuses and invokes the caller supplied function when a status update is received. The call will block until the request completes.
type ExecPipelineStatus ¶
type ExecPipelineStatus struct { Progress string RequestID string Error error Timestamp time.Time ResultURI string }
ExecPipelineStatus contains status / result information for a pipeline status request.
type ExecPipelineStatusListener ¶
type ExecPipelineStatusListener func(status ExecPipelineStatus)
ExecPipelineStatusListener defines a function type for handling pipeline execution result updates.
type SearchSolutionHandler ¶
type SearchSolutionHandler func(*pipeline.GetSearchSolutionsResultsResponse)
SearchSolutionHandler is executed when a new search solution is returned.