Package org.apache.sysds.api.mlcontext
Class ScriptFactory
java.lang.Object
org.apache.sysds.api.mlcontext.ScriptFactory
Factory for creating DML and PYDML Script objects from strings, files, URLs,
and input streams.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScriptCreate a DML Script object based on a string.static ScriptdmlFromFile(String scriptFilePath) Create a DML Script object based on a string path to a file.static ScriptdmlFromInputStream(InputStream inputStream) Create a DML Script object based on an input stream.static ScriptdmlFromLocalFile(File localScriptFile) Creates a DML Script object based on a file in the local file system.static ScriptdmlFromResource(String resourcePath) Create a DML Script object based on a resource path.static ScriptdmlFromString(String scriptString) Create a DML Script object based on a string.static ScriptdmlFromUrl(String scriptUrlPath) Create a DML Script object based on a URL path.static ScriptdmlFromUrl(URL scriptUrl) Create a DML Script object based on a URL.
-
Constructor Details
-
ScriptFactory
public ScriptFactory()
-
-
Method Details
-
dmlFromFile
Create a DML Script object based on a string path to a file.- Parameters:
scriptFilePath- path to DML script file (local or HDFS)- Returns:
- DML Script object
-
dmlFromInputStream
Create a DML Script object based on an input stream.- Parameters:
inputStream- input stream to DML- Returns:
- DML Script object
-
dmlFromLocalFile
Creates a DML Script object based on a file in the local file system. To create a DML Script object from a local file or HDFS, please usedmlFromFile(String).- Parameters:
localScriptFile- the local DML file- Returns:
- DML Script object
-
dmlFromString
Create a DML Script object based on a string.- Parameters:
scriptString- string of DML- Returns:
- DML Script object
-
dmlFromUrl
Create a DML Script object based on a URL path.- Parameters:
scriptUrlPath- URL path to DML script- Returns:
- DML Script object
-
dmlFromUrl
Create a DML Script object based on a URL.- Parameters:
scriptUrl- URL to DML script- Returns:
- DML Script object
-
dmlFromResource
Create a DML Script object based on a resource path.- Parameters:
resourcePath- path to a resource on the classpath- Returns:
- DML Script object
-
dml
Create a DML Script object based on a string.- Parameters:
scriptString- string of DML- Returns:
- DML Script object
-