Comments (4)
Hello @habib27,
Are you following the tutorial here ?
To transform a frame, you need to format it as mleap expects it. Here is an example for airbnb leap frame:
{
"schema": {
"fields": [{
"name": "state",
"type": "string"
}, {
"name": "bathrooms",
"type": "double"
}, {
"name": "square_feet",
"type": "double"
}, {
"name": "bedrooms",
"type": "double"
}, {
"name": "security_deposit",
"type": "double"
}, {
"name": "cleaning_fee",
"type": "double"
}, {
"name": "extra_people",
"type": "double"
}, {
"name": "number_of_reviews",
"type": "double"
}, {
"name": "review_scores_rating",
"type": "double"
}, {
"name": "room_type",
"type": "string"
}, {
"name": "host_is_superhost",
"type": "string"
}, {
"name": "cancellation_policy",
"type": "string"
}, {
"name": "instant_bookable",
"type": "string"
}]
},
"rows": [["NY", 2.0, 1250.0, 3.0, 50.0, 30.0, 2.0, 56.0, 90.0, "Entire home/apt", "1.0", "strict", "1.0"]]
}
Reference for leap frame: https://github.com/combust/mleap/blob/master/mleap-executor-testkit/src/main/resources/leap_frame/frame.airbnb.json
Then, to query the model simply do:
body=$(cat frame.airbnb.json)
curl --header "Content-Type: application/json" \
--header "timeout: 1000" \
--request POST \
--data "$body" http://localhost:8080/models/AirBnBLR/transform
from mleap.
Hey @ltrottier-yelp ,
Thank you for the reply.
Yes I followed that tutorial. The link to the airbnb frame does not work for me, says all access is disabled. But that payload I was able to find somewhere and use and it does work.
However, the issue is you see that type field that is being used there in the example, it's not in the swagger and I don't know what are the possible values for it. For example if I have a model where the value is double but the base is "Tensor", what type do I pass in to make it work?
I get this error :
"status": "STATUS_ERROR",
"error": "IllegalArgumentException: Cannot cast ScalarType(double,true) to TensorType(double,Some(WrappedArray(75)),true)
Is there anywhere I can find what the valid values are for this type field?
from mleap.
I'm taking a look at the swagger file, because it looks outdated. I'll try to update it soon.
The frame that you pass to the server is the same as a leap frame that you create in scala. It is simply its json representation. So you have two choices:
-
Create it via scala code and save it to json using the provided json FrameWriter. See here for a tutorial.
-
Create it yourself. Since the swagger is outdated, for now you can look at this file:
. This is where we define the parsing rules for json to create the leap frame. So for a tensor of type double, you need to define the type, base and dimensions.
from mleap.
Hey @ltrottier-yelp ,
Thank you very much for your help and prompt response. I appreciate it.
from mleap.
Related Issues (20)
- MLeap Transformer issue. HOT 1
- MathBinary input validation
- Mleap and python 3.8 HOT 27
- Exception in thread "Thread-4" java.lang.NoClassDefFoundError: ml/combust/bundle/HasBundleRegistry HOT 3
- Need help installing MLeap and XGBoost on databricks HOT 6
- Using XGBoost with the newest mleap=0.22.0 in Python 3.8 HOT 10
- Error while testing root project HOT 2
- org.apache.spark.sql.mleap.TypeConverters can not convert 2D tensor to Matrix
- Tensor to Proto Bug with SparseTensor: " java.lang.IllegalArgumentException: size of dimensions must equals size of values"
- org.apache.spark.ml.parity.SparkParityBase.spark should be a method
- Please release version 0.22.0 and 0.23.0 of mleap-spring-boot on dockerhub HOT 5
- Error building mleap-spring-boot HOT 7
- Update springboot to 2.7.10 and snakeyaml to 2.0
- Reporting a security issue in MLeap HOT 1
- Question about Mleap Spring Boot API HOT 2
- How to use XGBoost PySpark API with MLeap? HOT 3
- Need Help on Contributing towards Mleap for 2.13 HOT 3
- Pyspark DecisionTreeRegressionModel bundle does not include all attributes HOT 7
- Getting Key Not Found Exception while Serializing to a mleap bundle HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mleap.