问题
I was using Elastic 6.6.0 and kibana 6.6.0, vega and vega-lite were not experimental, every thing works good.
Now updated to elastic 7.6.0 and kibana 7.6.0 were vega and vega-lite showing experimental, also in version elastic 7.9.3 and kibana 7.9.3.
First question, whether experimental can be used for production integration, because don't want that to be dropped out or something after integration.
Second, I created a correlation matrix in kibana 6.6.0
Used following code
{
"$schema": "https://vega.github.io/schema/vega/v3.json",
"title": {
"text": "Correlation Matrix",
"anchor": "middle",
"fontSize": 16,
"frame": "group",
"offset": 4
},
"data":[
{
"name": "feature_correlation",
"url": {
"%context%": true,
"index": "creditloan.ml_models_v1.creditloandata-xgbclassifier-09dec2020-16h34m03s.corrmatrix",
"body": {
"size" : 0,
"aggs": {
"statistics": {
"matrix_stats": {
"fields": ['other_parties', 'purpose', 'housing','credit_amount', 'savings_status', 'employment', 'duration', 'residence_since', 'num_dependents', 'installment_commitment', 'own_telephone', 'credit_history', 'foreign_worker', 'property_magnitude', 'other_payment_plans', 'personal_status', 'checking_status', 'existing_credits', 'asnm', 'job', 'age']
}
}
}
}
},
"format": {"property": "aggregations.statistics.fields"},
"transform": [
{"type": "formula", "expr": "datum.correlation.other_parties", "as": "other_parties"},
{"type": "formula", "expr": "datum.correlation.purpose", "as": "purpose"},
{"type": "formula", "expr": "datum.correlation.housing", "as": "housing"},
{"type": "formula", "expr": "datum.correlation.credit_amount", "as": "credit_amount"},
{"type": "formula", "expr": "datum.correlation.savings_status", "as": "savings_status"},
{"type": "formula", "expr": "datum.correlation.employment", "as": "employment"},
{"type": "formula", "expr": "datum.correlation.duration", "as": "duration"},
{"type": "formula", "expr": "datum.correlation.residence_since", "as": "residence_since"},
{"type": "formula", "expr": "datum.correlation.num_dependents", "as": "num_dependents"},
{"type": "formula", "expr": "datum.correlation.installment_commitment", "as": "installment_commitment"},
{"type": "formula", "expr": "datum.correlation.own_telephone", "as": "own_telephone"},
{"type": "formula", "expr": "datum.correlation.credit_history", "as": "credit_history"},
{"type": "formula", "expr": "datum.correlation.foreign_worker", "as": "foreign_worker"},
{"type": "formula", "expr": "datum.correlation.property_magnitude", "as": "property_magnitude"},
{"type": "formula", "expr": "datum.correlation.other_payment_plans", "as": "other_payment_plans"},
{"type": "formula", "expr": "datum.correlation.personal_status", "as": "personal_status"},
{"type": "formula", "expr": "datum.correlation.checking_status", "as": "checking_status"},
{"type": "formula", "expr": "datum.correlation.existing_credits", "as": "existing_credits"},
{"type": "formula", "expr": "datum.correlation.asnm", "as": "asnm"},
{"type": "formula", "expr": "datum.correlation.job", "as": "job"},
{"type": "formula", "expr": "datum.correlation.age", "as": "age"},
{"type": "fold", "fields": ['other_parties', 'purpose', 'housing','credit_amount', 'savings_status', 'employment', 'duration', 'residence_since', 'num_dependents', 'installment_commitment', 'own_telephone', 'credit_history', 'foreign_worker', 'property_magnitude', 'other_payment_plans', 'personal_status', 'checking_status', 'existing_credits', 'asnm', 'job', 'age']},
{"type": "project", "fields": ["name", "key", "value"]}
]
}],
"scales": [
{
"name": "x",
"type": "band",
"domain": {"data": "feature_correlation", "field": "name"},
"range": "width"
"nice": true,
"zero": true
},
{
"name": "y",
"type": "band",
"domain": {"data": "feature_correlation", "field": "key"},
"range": "height"
},
{
"name": "color",
"type": "linear",
"range": {"scheme": "Viridis"},
"domain": {"data": "feature_correlation", "field": "value"},
"zero": false,
"nice": true
}
],
"axes": [
{
"orient": "bottom",
"scale": "x",
"labelOverlap":false,
"domain": false,
"title": "Features",
"encode": {
"labels": {
"update": {
"angle": {"value": -50},
"fontSize": {"value": 10},
"align": {"value": "right"}
}
}
}
},
{
"orient": "left",
"scale": "y",
"domain": false,
"title": "Features"
"encode": {
"labels": {
"update": {
"fontSize": {"value": 10},
"align": {"value": "right"}
}
}
}
}
],
"legends": [
{
"direction": "vertical",
"orient": "bottom",
"fill": "color",
"type": "gradient",
"title": "Correlation",
"titleFontSize": 12,
"titlePadding": 4,
"gradientLength": {"signal": "height - 16"}
"encode": {
"labels": {
"update": {
"fontSize": {"value": 12}
}
}
}
}
],
"marks": [
{
"type": "rect",
"from": {"data": "feature_correlation"},
"encode": {
"enter": {
"x": {"scale": "x", "field": "name"},
"y": {"scale": "y", "field": "key"},
"width": {"scale": "x", "band": 1},
"height": {"scale": "y", "band": 1},
"tooltip": {"signal": "datum.name + ' - ' + datum.key + ': ' + format(datum.value, '.4f')"}
},
"update": {
"fill": {"scale": "color", "field": "value"}
}
}
}
]
}
Works Good
After update to kibana 7.6.0 also tried in Kibana 7.9.3
Same Code shows like below, also changed the version as "https://vega.github.io/schema/vega/v4.3.0.json", still not working
May I know how to fix this
Third Question: Online Vega Editors using verions like
vega - v5, but if i use in kibana 7.9.3 or 7.6.0 i get
The input spec uses vega v5, but current version of vega is 4.3.0
vega-lite - v4, if i use v4, i get
The input spec uses vega-lite v4, but current version of vega-lite is 2.6.0.
May i know whats that mean and what should i use
回答1:
Made this change, single quotes to double quotes, it worked
{"type": "fold", "fields": ["installment_commitment", "credit_amount", "num_dependents","duration", "existing_credits", "asnm", "age", "residence_since", "purpose", "own_telephone", "property_magnitude", "job", "housing", "personal_status", "checking_status", "other_parties", "other_payment_plans", "savings_status", "employment", "foreign_worker","credit_history"]}
来源:https://stackoverflow.com/questions/65226557/correlation-matrix-not-working-in-new-version-of-vega