Skip to content

Commit

Permalink
Added local scoring example
Browse files Browse the repository at this point in the history
  • Loading branch information
tovbinm committed Aug 31, 2018
1 parent 6c3e8d0 commit 1120d82
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ libraryDependencies ++= "com.salesforce.transmogrifai" %% "transmogrifai-local"
libraryDependencies ++= libraryDependencies += "com.opendatagroup" % "hadrian" % "0.8.5" % Runtime
```

Then in your code you might score as follows:
```scala
import com.salesforce.op.local._

val model = workflow.loadModel("/path/to/model")
val scoreFn = model.scoreFunction
val rawData = Seq(Map("age" -> 18, "name" -> "Peter"), Map("name" -> "John"))
val scores= rawData.map(scoreFn)
```

Or using the local runner:
```scala
val scoreFn = new OpWorkflowRunnerLocal(workflow).score(opParams)
```


## Performance Results

Below is an example of measured scoring performance on 6m records with 10 fields and 12 transformations applied.
Expand Down

0 comments on commit 1120d82

Please sign in to comment.