Skip to content

Commit

Permalink
v2.31.0.9000 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahjota authored Jul 18, 2023
1 parent 956ce96 commit cbffaee
Show file tree
Hide file tree
Showing 33 changed files with 7,619 additions and 2,449 deletions.
13 changes: 7 additions & 6 deletions datarobot/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: datarobot
Title: 'DataRobot' Predictive Modeling API
Version: 2.29.0.9003
Version: 2.31.0.9000
Description: For working with the 'DataRobot' predictive modeling platform's
API <https://www.datarobot.com/>.
Depends: R (>= 3.5), methods, stats, datarobot.apicore
Expand All @@ -22,13 +22,14 @@ Author: Ron Pearson [aut],
Mykhailo Poliakov [ctb],
DataRobot, Inc. [cph]
Maintainer: AJ Alon <[email protected]>
Suggests: lubridate, testthat, stubthat, devtools (>= 2.4.1), knitr,
rmarkdown, lintr, data.table, AmesHousing, mlbench, beanplot,
doBy, insuranceData, ggplot2, modelwordcloud, withr, memoise
Suggests: lubridate, testthat, stubthat, mockery, devtools (>= 2.4.1),
knitr, rmarkdown, lintr, data.table, AmesHousing, mlbench,
beanplot, doBy, insuranceData, ggplot2, modelwordcloud, withr,
memoise
VignetteBuilder: knitr
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
NeedsCompilation: no
Packaged: 2022-11-01 20:06:18 UTC; aj
Packaged: 2023-07-14 19:20:15 UTC; aj
Language: en-US
Config/testthat/edition: 2
Remotes: r-lib/devtools
Expand Down
6 changes: 0 additions & 6 deletions datarobot/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export(CreatePrimeCode)
export(CreateProjectCleanupJobs)
export(CreateProjectsBiasMitigatedModels)
export(CreateProjectsDatetimeModelsFeatureEffects)
export(CreateProjectsDatetimeModelsFeatureFit)
export(CreateProjectsDatetimeModelsFromModel)
export(CreateProjectsDatetimeModelsMulticlassFeatureEffects)
export(CreateProjectsDatetimePartitioning)
Expand All @@ -147,7 +146,6 @@ export(CreateProjectsModelsCrossClassAccuracyScores)
export(CreateProjectsModelsDataDisparityInsights)
export(CreateProjectsModelsFairnessInsights)
export(CreateProjectsModelsFeatureEffects)
export(CreateProjectsModelsFeatureFit)
export(CreateProjectsModelsFromModel)
export(CreateProjectsModelsImageActivationMaps)
export(CreateProjectsModelsImageEmbeddings)
Expand Down Expand Up @@ -536,8 +534,6 @@ export(ListProjectsDatetimeModelsDatasetAccuracyOverTimePlotsMetadata)
export(ListProjectsDatetimeModelsDatasetAccuracyOverTimePlotsPreview)
export(ListProjectsDatetimeModelsFeatureEffects)
export(ListProjectsDatetimeModelsFeatureEffectsMetadata)
export(ListProjectsDatetimeModelsFeatureFit)
export(ListProjectsDatetimeModelsFeatureFitMetadata)
export(ListProjectsDatetimeModelsForecastDistanceStabilityPlot)
export(ListProjectsDatetimeModelsMulticlassFeatureEffects)
export(ListProjectsDatetimeModelsMultiseriesHistograms)
Expand Down Expand Up @@ -580,8 +576,6 @@ export(ListProjectsModelsDatasetRocCurves)
export(ListProjectsModelsFairnessInsights)
export(ListProjectsModelsFeatureEffects)
export(ListProjectsModelsFeatureEffectsMetadata)
export(ListProjectsModelsFeatureFit)
export(ListProjectsModelsFeatureFitMetadata)
export(ListProjectsModelsFeatureListsClusterInsights)
export(ListProjectsModelsImageActivationMaps)
export(ListProjectsModelsImageEmbeddings)
Expand Down
33 changes: 33 additions & 0 deletions datarobot/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# datarobot v2.31.0.9000

This release addresses an issue where a new feature in the `curl==5.0.1` package that caused any invocation of `datarobot:::UploadData` (i.e. `SetupProject`) to fail with the error `No method asJSON S3 class: form_file`.

New API Functions:

Other New Features:

Enhancements:

* The un-exported function `datarobot:::UploadData` now takes an optional argument `fileName`.

Bugfixes:

* Fixed an issue where a [new feature](https://github.com/jeroen/curl/pull/290/) in curl==5.0.1 is installed that caused any invocation of `datarobot:::UploadData` (i.e. `SetupProject`) to fail with the error `No method asJSON S3 class: form_file`.
* Loading the `datarobot` package with `suppressPackageStartupMessages()` will now suppress all messages.

API Changes:

Deprecated and Defunct:
* `CreateProjectsDatetimeModelsFeatureFit` has been removed. Use `CreateProjectsDatetimeModelsFeatureEffects` instead.
* `ListProjectsDatetimeModelsFeatureFit` has been removed. Use `ListProjectsDatetimeModelsFeatureEffects` instead.
* `ListProjectsDatetimeModelsFeatureFitMetadata` has been removed. Use `ListProjectsDatetimeModelsFeatureEffectsMetadata` instead.
* `CreateProjectsModelsFeatureFit` has been removed. Use `CreateProjectsModelsFeatureEffects` instead.
* `ListProjectsModelsFeatureFit` has been removed. Use `ListProjectsModelsFeatureEffects` instead.
* `ListProjectsModelsFeatureFitMetadata` has been removed. Use `ListProjectsModelsFeatureEffectsMetadata` instead.

Dependency Changes:
* Client documentation is now explicitly generated with Roxygen2 v7.2.3.
* Added `Suggests: mockery` to improve unit test development experience.

Documentation Changes:

# datarobot v2.29.0.9003

API Changes:
Expand Down
9 changes: 7 additions & 2 deletions datarobot/R/AdvancedTuning.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@
#' @param model dataRobotModel. A DataRobot model object to get tuning parameters for.
#' @return A list detailing the following about each tuning parameter:
#' \itemize{
#' \item currentValue character. The current searched values of that parameter.
#' \item defaultValue character. The default value of that parameter.
#' \item currentValue character. The single value or list of values of the
#' parameter that were grid searched. Depending on the grid search
#' specification, could be a single fixed value (no grid search),
#' a list of discrete values, or a range.
#' \item defaultValue character. The actual value used to train the model; either
#' the single value of the parameter specified before training, or the best
#' value from the list of grid-searched values (based on `current_value`).
#' \item parameterId character. A unique ID for that particular parameter.
#' \item parameterName character. The name of the tuning parameter.
#' \item taskName character. The name of the task the parameter is for.
Expand Down
4 changes: 2 additions & 2 deletions datarobot/R/ConnectToDataRobot.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ConnectToDataRobot <- function(endpoint = NULL,
ConnectWithUsernamePassword(endpoint, username, password)
} else if (haveConfigPath) {
ConnectWithConfigFile(configPath)
} else if (!is.na(envEndpoint) & !is.na(envToken)) {
} else if (!is.na(envEndpoint) && !is.na(envToken)) {
ConnectWithToken(envEndpoint, envToken)
} else {
errorMsg <- "No authentication method provided."
Expand Down Expand Up @@ -164,7 +164,7 @@ ConnectWithUsernamePassword <- function(endpoint, username, password) {
}

SaveConnectionEnvironmentVars <- function(endpoint, token) {
message("Authentication token saved")
packageStartupMessage("Authentication token saved")
Sys.setenv(DATAROBOT_API_ENDPOINT = endpoint)
Sys.setenv(DATAROBOT_API_TOKEN = token)
}
Expand Down
20 changes: 18 additions & 2 deletions datarobot/R/UploadData.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,25 @@
#'
#' @seealso SetupProject
#' @param dataSource character. The file to upload.
#' @param fileName character. The name of the file after it is uploaded. If not set, defaults
#' to the name of the uploaded file.
#' @return An httr object specifying the form upload content of the file path.
UploadData <- function(dataSource) {
httr::upload_file(DataPathFromDataArg(dataSource))
UploadData <- function(dataSource, fileName = NULL) {
if (!is.null(fileName)) {
stopifnot(is.character(fileName))
}
dataPath <- DataPathFromDataArg(dataSource)
content <- httr::upload_file(dataPath)
if ("name" %in% names(content) && is.null(content$name)) {
# DSX-2862
# httr::upload_file invokes curl::form_file. In curl<5.0.1, this function
# returns a length-2 list containing $path and $type. In curl==5.0.1, thanks to
# https://github.com/jeroen/curl/pull/290 this function returns an extra $name.
# To ensure this works properly with `datarobot:::TryingToBeNull()`, set $name
# to the path.
content$name <- ifelse(is.null(fileName), yes = basename(dataPath), no = fileName)
}
invisible(content)
}

#' Get the data path.
Expand Down
97 changes: 0 additions & 97 deletions datarobot/R/insights_apiWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,55 +370,6 @@ ListProjectsDatetimeModelsFeatureEffectsMetadata <- function(modelId, projectId,
return(datarobot.apicore::InsightsApi$new()$ProjectsDatetimeModelsFeatureEffectsMetadataList(modelId = modelId, projectId = projectId, ...))
}

#' CreateProjectsDatetimeModelsFeatureFit
#'
#' Add a request to the queue to calculate Feature Fit for a backtest.
#'
#' NOTE: Starting from API v2.29 this endpoint will be deprecated. Add a request to the queue to calculate Feature Fit for a backtest. If the job has been previously submitted, the request fails, returning the jobId of the previously submitted job. Use this jobId to check status of the previously submitted job.
#' @details This method invokes `POST /projects/{projectId}/datetimeModels/{modelId}/featureFit/` in the DataRobot Public API.
#'
#' @param ... Additional keyword arguments to be passed on to the `datarobot.apicore` and `httr` libraries.
#'
#' @seealso The method ProjectsDatetimeModelsFeatureFitCreate in [datarobot.apicore::InsightsApi], which invokes the same underlying API endpoint.
#' @export
#' @md
CreateProjectsDatetimeModelsFeatureFit <- function(backtestIndex, modelId, projectId, ...) {
modelXrayCreateDatetime <- datarobot.apicore::ModelXrayCreateDatetime$new(backtestIndex = backtestIndex, validateParams = TRUE)
return(datarobot.apicore::InsightsApi$new()$ProjectsDatetimeModelsFeatureFitCreate(modelXrayCreateDatetime = modelXrayCreateDatetime, modelId = modelId, projectId = projectId, ...))
}

#' ListProjectsDatetimeModelsFeatureFit
#'
#' Retrieve Feature Fit for a model backtest.
#'
#' NOTE: Starting from API v2.29 this endpoint will be deprecated. Retrieve Feature Fit for a model backtest. Feature Fit provides partial dependence and predicted vs actual values for the top 500 features, ordered by feature importance score. The partial dependence shows marginal effect of a feature on the target variable after accounting for the average effects of all other predictive features. It indicates how, holding all other variables except the feature of interest as they were, the value of this feature affects your prediction. If a Feature Fit job was previously submitted for a given backtest, this endpoint will return a response structured as {\"message\": \\<message\\>, \"jobId\": \\<jobId\\>} where jobId is the ID of the job. Retrieve the job with :<http:get>:/api/v2/projects/(projectId)/jobs/(jobId)/
#' @details This method invokes `GET /projects/{projectId}/datetimeModels/{modelId}/featureFit/` in the DataRobot Public API.
#'
#' @param ... Additional keyword arguments to be passed on to the `datarobot.apicore` and `httr` libraries.
#'
#' @seealso The method ProjectsDatetimeModelsFeatureFitList in [datarobot.apicore::InsightsApi], which invokes the same underlying API endpoint.
#' @export
#' @md
ListProjectsDatetimeModelsFeatureFit <- function(backtestIndex, modelId, projectId, includeIcePlots, source = "training", ...) {
return(datarobot.apicore::InsightsApi$new()$ProjectsDatetimeModelsFeatureFitList(backtestIndex = backtestIndex, modelId = modelId, source = source, projectId = projectId, includeIcePlots = includeIcePlots, ...))
}

#' ListProjectsDatetimeModelsFeatureFitMetadata
#'
#' Retrieve Feature Fit metadata for each backtest. Response contains status and available sources for each backtest of the model.
#'
#' NOTE: Starting from API v2.29 this endpoint will be deprecated. Retrieve Feature Fit metadata for each backtest. Response contains status and available sources for each backtest of the model. One of the provided backtestIndex indexes used for submitting the compute request and retrieving Feature Fit. \\* Start/stop models contain a single backtestIndex response value of startstop. \\* Other models contain backtestIndex of 0, 1, ..., holdout. One of the provided source parameters used for retrieving Feature Fit. \\* Each backtest source can be, at a minimum, training or validation. If holdout is configured for the project, backtestIndex also includes holdout with sources training and holdout. \\* Source value of training is always available. (versions prior to v2.17 support validation only) \\* When a start/stop model is trained into validation or holdout without stacked predictions (i.e., no out-of-sample predictions in validation or holdout), validation and holdout sources are not available. \\* Source holdout is not available when there is no holdout configured for the project.
#' @details This method invokes `GET /projects/{projectId}/datetimeModels/{modelId}/featureFitMetadata/` in the DataRobot Public API.
#'
#' @param ... Additional keyword arguments to be passed on to the `datarobot.apicore` and `httr` libraries.
#'
#' @seealso The method ProjectsDatetimeModelsFeatureFitMetadataList in [datarobot.apicore::InsightsApi], which invokes the same underlying API endpoint.
#' @export
#' @md
ListProjectsDatetimeModelsFeatureFitMetadata <- function(modelId, projectId, ...) {
return(datarobot.apicore::InsightsApi$new()$ProjectsDatetimeModelsFeatureFitMetadataList(modelId = modelId, projectId = projectId, ...))
}

#' ListProjectsDatetimeModelsForecastDistanceStabilityPlot
#'
#' Retrieve a plot displaying the stability of the time series model across different forecast distances.
Expand Down Expand Up @@ -1134,54 +1085,6 @@ ListProjectsModelsFeatureEffectsMetadata <- function(modelId, projectId, ...) {
return(datarobot.apicore::InsightsApi$new()$ProjectsModelsFeatureEffectsMetadataList(modelId = modelId, projectId = projectId, ...))
}

#' CreateProjectsModelsFeatureFit
#'
#' Add a request to the queue to calculate Feature Fit.
#'
#' NOTE: Starting from API v2.29 this endpoint will be deprecated. Add a request to the queue to calculate Feature Fit. If the job has been previously submitted, the request fails, returning the jobId of the previously submitted job. Use this jobId to check status of the previously submitted job.
#' @details This method invokes `POST /projects/{projectId}/models/{modelId}/featureFit/` in the DataRobot Public API.
#'
#' @param ... Additional keyword arguments to be passed on to the `datarobot.apicore` and `httr` libraries.
#'
#' @seealso The method ProjectsModelsFeatureFitCreate in [datarobot.apicore::InsightsApi], which invokes the same underlying API endpoint.
#' @export
#' @md
CreateProjectsModelsFeatureFit <- function(modelId, projectId, ...) {
return(datarobot.apicore::InsightsApi$new()$ProjectsModelsFeatureFitCreate(modelId = modelId, projectId = projectId, ...))
}

#' ListProjectsModelsFeatureFit
#'
#' Retrieve Feature Fit for the model.
#'
#' NOTE: Starting from API v2.29 this endpoint will be deprecated. Retrieve Feature Fit for the model. Feature Fit provides partial dependence and predicted vs actual values for the top 500 features, ordered by feature importance score. The partial dependence shows marginal effect of a feature on the target variable after accounting for the average effects of all other predictive features. It indicates how, holding all other variables except the feature of interest as they were, the value of this feature affects your prediction. If a Feature Fit job was previously submitted, this endpoint will return a response structured as {\"message\": \\<message\\>, \"jobId\": \\<jobId\\>} where jobId is the ID of the job. Retrieve the job with :<http:get>:/api/v2/projects/(projectId)/jobs/(jobId)/
#' @details This method invokes `GET /projects/{projectId}/models/{modelId}/featureFit/` in the DataRobot Public API.
#'
#' @param ... Additional keyword arguments to be passed on to the `datarobot.apicore` and `httr` libraries.
#'
#' @seealso The method ProjectsModelsFeatureFitList in [datarobot.apicore::InsightsApi], which invokes the same underlying API endpoint.
#' @export
#' @md
ListProjectsModelsFeatureFit <- function(modelId, projectId, includeIcePlots, source = "training", ...) {
return(datarobot.apicore::InsightsApi$new()$ProjectsModelsFeatureFitList(modelId = modelId, source = source, projectId = projectId, includeIcePlots = includeIcePlots, ...))
}

#' ListProjectsModelsFeatureFitMetadata
#'
#' Retrieve Feature Fit metadata. Response contains status and available sources.
#'
#' NOTE: Starting from API v2.29 this endpoint will be deprecated. Retrieve Feature Fit metadata. Response contains status and available sources. One of the provided source parameters used for retrieving Feature Fit. \\* Source can be, at a minimum, training or validation. If holdout is configured for the project, source also includes holdout. \\* Source value of training is always available.(versions prior to v2.17 support validation only) \\* When a model is trained into validation or holdout without stacked predictions (i.e., no out-of-sample predictions in validation or holdout), validation and holdout sources are not available.
#' @details This method invokes `GET /projects/{projectId}/models/{modelId}/featureFitMetadata/` in the DataRobot Public API.
#'
#' @param ... Additional keyword arguments to be passed on to the `datarobot.apicore` and `httr` libraries.
#'
#' @seealso The method ProjectsModelsFeatureFitMetadataList in [datarobot.apicore::InsightsApi], which invokes the same underlying API endpoint.
#' @export
#' @md
ListProjectsModelsFeatureFitMetadata <- function(modelId, projectId, ...) {
return(datarobot.apicore::InsightsApi$new()$ProjectsModelsFeatureFitMetadataList(modelId = modelId, projectId = projectId, ...))
}



#' ListProjectsModelsFeatureListsClusterInsights
Expand Down
Binary file modified datarobot/build/vignette.rds
Binary file not shown.
Loading

0 comments on commit cbffaee

Please sign in to comment.