com.databricks:automatedml_2.11

Databricks Labs AutoML toolkit

License

License

Categories

Categories

Data Auto Application Layer Libs Code Generators
GroupId

GroupId

com.databricks
ArtifactId

ArtifactId

automatedml_2.11
Last Version

Last Version

0.7.2
Release Date

Release Date

Type

Type

jar
Description

Description

com.databricks:automatedml_2.11
Databricks Labs AutoML toolkit
Project URL

Project URL

https://github.com/databrickslabs/automl-toolkit
Project Organization

Project Organization

com.databricks
Source Code Management

Source Code Management

https://github.com/databrickslabs/automl-toolkit

Download automatedml_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/com.databricks/automatedml_2.11/ -->
<dependency>
    <groupId>com.databricks</groupId>
    <artifactId>automatedml_2.11</artifactId>
    <version>0.7.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.databricks/automatedml_2.11/
implementation 'com.databricks:automatedml_2.11:0.7.2'
// https://jarcasting.com/artifacts/com.databricks/automatedml_2.11/
implementation ("com.databricks:automatedml_2.11:0.7.2")
'com.databricks:automatedml_2.11:jar:0.7.2'
<dependency org="com.databricks" name="automatedml_2.11" rev="0.7.2">
  <artifact name="automatedml_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.databricks', module='automatedml_2.11', version='0.7.2')
)
libraryDependencies += "com.databricks" % "automatedml_2.11" % "0.7.2"
[com.databricks/automatedml_2.11 "0.7.2"]

Dependencies

compile (2)

Group / Artifact Type Version
ml.combust.mleap : mleap-runtime_2.11 jar 0.14.0
ml.combust.mleap : mleap-spark_2.11 jar 0.14.0

provided (11)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.11.12
org.apache.spark : spark-core_2.11 jar 2.4.0
org.apache.spark : spark-sql_2.11 jar 2.4.0
org.apache.spark : spark-mllib_2.11 jar 2.4.0
org.mlflow : mlflow-client jar 1.3.0
org.json4s : json4s-jackson_2.11 jar 3.5.3
ml.dmlc : xgboost4j jar 0.90
ml.dmlc : xgboost4j-spark jar 0.90
com.microsoft.ml.spark : mmlspark_2.11 jar 0.18.1
org.vegas-viz : vegas_2.11 jar 0.3.11
com.databricks : dbutils-api_2.11 jar 0.0.4

test (2)

Group / Artifact Type Version
junit : junit jar 4.8.1
org.scalatest : scalatest_2.11 jar 3.0.6

Project Modules

There are no modules declared in this project.

Databricks Labs AutoML

Release Notes | Python API Docs | Python Artifact Developer Docs | Python Docs | Demo | Release Artifacts | Contributors

This Databricks Labs project is a non-supported end-to-end supervised learning solution for automating:

  • Feature clean-up
    • Advanced NA fill, covariance calculations, collinearity determination, outlier filtering, and data casting
  • Feature Importance calculation suite
    • RandomForest or XGBoost determinations
  • Feature Interaction with Information Gain selection
  • Feature vectorization
  • Advanced train/test split techniques (including Distributed SMOTE (KSample))
  • Model selection and training
  • Hyper parameter optimization and selection
    • Hyperspace, Genetic, and MBO-based selection
  • Batch Prediction through serialized SparkML Pipelines
  • Logging of model results and training runs (using MLFlow)

This package utilizes Apache Spark ML and currently supports the following model family types:

  • Decision Trees (Regressor and Classifier)
  • Gradient Boosted Trees (Regressor and Classifier)
  • Random Forest (Regressor and Classifier)
  • Linear Regression
  • Logistic Regression
  • Multi-Layer Perceptron Classifier
  • Support Vector Machines
  • XGBoost (Regressor and Classifier)

NOTE: LightGBM support is built-in, but is in Experimental mode and canoot be accessed from the FamilyRunner API while we are undergoing testing and evaluation of thread concurrency issues with the LightGBM code base.

Documentation

Scala API documentation can be found here

Python API documentation can be found here

Building

Databricks Labs AutoML can be build with either SBT or Maven.

This package requires Java 1.8.x  and scala 2.11.x to be installed on your system prior to building.

After cloning this repo onto your local system, navigate to the root directory and execute either:

Maven Build
mvn clean install -DskipTests
SBT Build
sbt package

If there is any StackOverflowError during the build, adjust the stack size on your computer's JVM. Example:

#For Maven
export MAVEN_OPTS=-Xss2m
#For SBT
export SBT_OPTS="-Xss2M"

This will skip unit test execution (it is not recommended to run unit tests in local mode against this package as unit testing is asynchronous and incredibly CPU intensive for this code base.)

Setup

Once the artifact has been built, attach to the Databricks Shard through either the DBFS API or the GUI. Once loaded into the account, utilize either the Libraries API to attach to a cluster, or utilize the GUI to attach the .jar to the cluster.

NOTE: It is not recommended to attach this libarary to all clusters on the account.  

Use of an ML Runtime cluster configuration is highly advised to ensure that custom management of dependent 
libraries and configurations are provided 'out of the box'

Attach the following libraries to the cluster:

  • The automl toolkit jar created above. (automatedml_2.11-((version)).jar)
  • If using the PySpark API for the toolkit, the .whl file for the PySpark API.

IMPORTANT NOTE: as of release 0.7.1, the mlflow libraries in pypi and Maven are NO LONGER NEEDED. Attaching them to your cluster WILL prevent the run from logging and will throw an exception. DO NOT ATTACH EITHER OF THEM.

Getting Started

This package provides a number of different levels of API interaction, from the highest-level "default only" FamilyRunner to low-level APIs that allow for highly customizable workflows to be created for automated ML tuning and Inference.

For the purposes of a quick-start intro, the below example is of the highest-level API access point.

import com.databricks.labs.automl.executor.config.ConfigurationGenerator
import com.databricks.labs.automl.executor.FamilyRunner

val data = spark.table("ben_demo.adult_data")

val overrides = Map("labelCol" -> "income",
"mlFlowExperimentName" -> (defaults to current notebook directory),
"mlFlowModelSaveDirectory" -> "dbfs:/ml/FirstAutoMLRun/",
"inferenceConfigSaveLocation" -> "dbfs:/ml/FirstAutoMLRun/inference"
)

val randomForestConfig = ConfigurationGenerator.generateConfigFromMap("RandomForest", "classifier", overrides)
val gbtConfig = ConfigurationGenerator.generateConfigFromMap("GBT", "classifier", overrides)
val logConfig = ConfigurationGenerator.generateConfigFromMap("LogisticRegression", "classifier", overrides)

val runner = FamilyRunner(data, Array(randomForestConfig, gbtConfig, logConfig)).execute()

This example will take the default configuration for all of the application parameters (excepting the overridden parameters in overrides Map) and execute Data Preparation tasks, Feature Vectorization, and automatic tuning of all 3 specified model types. At the conclusion of each run, the results and model artifacts will be logged to the mlflow location that was specified in the configuration.

For a listing of all available parameter overrides and their functionality, see the Developer Docs

Pipeline API

v0.6.0

Starting with this release, AutoML now exposes an API to work with the pipeline semantics around feature engineering steps and full predict pipelines. Example:

import com.databricks.labs.automl.executor.config.ConfigurationGenerator
import com.databricks.labs.automl.executor.FamilyRunner
import org.apache.spark.ml.PipelineModel

val data = spark.table("ben_demo.adult_data")
val overrides = Map(
  "labelCol" -> "label", 
  "mlFlowLoggingFlag" -> false,
  "scalingFlag" -> true, 
  "oneHotEncodeFlag" -> true,
  "pipelineDebugFlag" -> true
)
val randomForestConfig = ConfigurationGenerator
  .generateConfigFromMap("RandomForest", "classifier", overrides)

val runner = FamilyRunner(data, Array(randomForestConfig)).executeWithPipeline()

runner.bestPipelineModel("RandomForest").transform(data)

//Serialize it
runner.bestPipelineModel("RandomForest").write.overwrite().save("tmp/predict-pipeline-1")

// Load it for running inference
val pipelineModel = PipelineModel.load("tmp/predict-pipeline-1")
val predictDf = pipelineModel.transform(data)

Inference via Mlflow Run ID

It is also possible to use MlFlow Run ID for inference, if Mlflow logging is turned on during training. For usage, see this

For all available pipeline APIs. please see Developer Docs

Feedback

Issues with the application? Found a bug? Have a great idea for an addition? Feel free to file an issue.

Contributing

Have a great idea that you want to add? Fork the repo and submit a PR!

Legal Information

This software is provided as-is and is not officially supported by Databricks through customer technical support channels. Support, questions, and feature requests can be communicated via email -> [email protected] or through the Issues page of this repo. Please see the legal agreement and understand that issues with the use of this code will not be answered or investigated by Databricks Support.

Core Contribution team

  • Lead Developer: Ben Wilson, Practice Leader, Databricks
  • Developer: Daniel Tomes, RSA Practice Leader, Databricks
  • Developer: Jas Bali, Sr. Solutions Consultant, Databricks
  • Developer: Mary Grace Moesta, Customer Success Engineer, Databricks
com.databricks

Databricks Labs

Labs projects to accelerate use cases on the Databricks Unified Analytics Platform

Versions

Version
0.7.2