Skip to content

Instantly share code, notes, and snippets.

@blehman
Created March 26, 2024 19:13
Show Gist options
  • Save blehman/78a49c0233f821103a8917891f760432 to your computer and use it in GitHub Desktop.
Save blehman/78a49c0233f821103a8917891f760432 to your computer and use it in GitHub Desktop.
Coherence Scores (CorEx Comp)
{
"config": {
"view": {"continuousWidth": 300, "continuousHeight": 300},
"axis": {"titleFont": "Courier", "titleFontSize": 15},
"axisBottom": {
"labelColor": "gray",
"titleColor": "gray",
"titleFont": "Courier"
},
"axisLeft": {
"labelColor": "black",
"titleColor": "black",
"titleFont": "Courier"
},
"axisRight": {
"labelColor": "#2ca02c",
"titleColor": "#2ca02c",
"titleFont": "Courier"
},
"legend": {
"labelFont": "Courier",
"labelFontSize": 15,
"labelOverlap": false,
"symbolSize": 400,
"symbolStrokeWidth": 5,
"title": null,
"titleFontSize": 15
},
"title": {
"anchor": "start",
"color": "gray",
"font": "Courier",
"fontSize": 30
}
},
"layer": [
{
"mark": {"type": "line"},
"encoding": {"color": {"field": "model_name", "type": "nominal"}},
"transform": [{"fold": ["c_v", "u_mass"], "as": ["Measure", "Value"]}]
},
{
"mark": {"type": "line", "opacity": 0.9, "point": true},
"encoding": {
"color": {"field": "model_name", "type": "nominal"},
"tooltip": [
{"field": "c_v", "type": "quantitative"},
{"field": "model_name", "type": "nominal"},
{"field": "num_topics", "type": "quantitative"}
],
"x": {"field": "num_topics", "type": "quantitative"},
"y": {"field": "c_v", "title": "c_v score", "type": "quantitative"}
},
"transform": [{"fold": ["c_v", "u_mass"], "as": ["Measure", "Value"]}]
},
{
"mark": {"type": "line", "opacity": 1, "point": true},
"encoding": {
"color": {"field": "model_name", "type": "nominal"},
"tooltip": [
{"field": "u_mass", "type": "quantitative"},
{"field": "model_name", "type": "nominal"},
{"field": "num_topics", "type": "quantitative"}
],
"x": {"field": "num_topics", "type": "quantitative"},
"y": {
"field": "u_mass",
"title": "u_mass score",
"type": "quantitative"
}
},
"transform": [{"fold": ["c_v", "u_mass"], "as": ["Measure", "Value"]}]
},
{
"mark": {
"type": "circle",
"fillOpacity": 0,
"size": 70,
"stroke": "#2ca02c"
},
"encoding": {
"color": {"field": "model_name", "type": "nominal"},
"tooltip": [
{"field": "u_mass", "type": "quantitative"},
{"field": "model_name", "type": "nominal"},
{"field": "num_topics", "type": "quantitative"}
],
"x": {"field": "num_topics", "type": "quantitative"},
"y": {
"axis": {"labels": false},
"field": "u_mass",
"title": "",
"type": "quantitative"
}
},
"transform": [{"fold": ["c_v", "u_mass"], "as": ["Measure", "Value"]}]
},
{
"mark": {
"type": "circle",
"fillOpacity": 0,
"size": 70,
"stroke": "black"
},
"encoding": {
"color": {"field": "model_name", "type": "nominal"},
"tooltip": [
{"field": "c_v", "type": "quantitative"},
{"field": "model_name", "type": "nominal"},
{"field": "num_topics", "type": "quantitative"}
],
"x": {
"field": "num_topics",
"scale": {"domain": [2, 20.9]},
"type": "quantitative"
},
"y": {
"axis": {"labels": false},
"field": "c_v",
"title": "",
"type": "quantitative"
}
},
"transform": [{"fold": ["c_v", "u_mass"], "as": ["Measure", "Value"]}]
}
],
"data": {"name": "data-5d352d2ae8b02f0109d1e69dcd28ce73"},
"height": 400,
"resolve": {"scale": {"y": "independent"}},
"title": {"text": ["Topic Model(s) Coherence Scores"], "subtitle": [""]},
"width": 800,
"$schema": "https://vega.github.io/schema/vega-lite/v5.8.0.json",
"datasets": {
"data-5d352d2ae8b02f0109d1e69dcd28ce73": [
{
"c_v": 0.2856809926763051,
"u_mass": -13.010927670768995,
"num_topics": 3,
"model_name": "m2corex"
},
{
"c_v": 0.3737941730584274,
"u_mass": -11.406371825330694,
"num_topics": 4,
"model_name": "m2corex"
},
{
"c_v": 0.32975667256024827,
"u_mass": -11.121426491129698,
"num_topics": 5,
"model_name": "m2corex"
},
{
"c_v": 0.2845268706734317,
"u_mass": -15.071343753784946,
"num_topics": 6,
"model_name": "m2corex"
},
{
"c_v": 0.32612510120534866,
"u_mass": -12.228377746242657,
"num_topics": 7,
"model_name": "m2corex"
},
{
"c_v": 0.44789855677005647,
"u_mass": -10.614103367051236,
"num_topics": 8,
"model_name": "m2corex"
},
{
"c_v": 0.3822080649006964,
"u_mass": -13.065920918792306,
"num_topics": 9,
"model_name": "m2corex"
},
{
"c_v": 0.31961314663956275,
"u_mass": -12.5788582150558,
"num_topics": 10,
"model_name": "m2corex"
},
{
"c_v": 0.30457918470840484,
"u_mass": -13.459688540222079,
"num_topics": 11,
"model_name": "m2corex"
},
{
"c_v": 0.31499705061969235,
"u_mass": -14.72626632130961,
"num_topics": 3,
"model_name": "m2symmetric"
},
{
"c_v": 0.32573459981328906,
"u_mass": -13.16795784943859,
"num_topics": 4,
"model_name": "m2symmetric"
},
{
"c_v": 0.3052518045008154,
"u_mass": -10.23576784104363,
"num_topics": 5,
"model_name": "m2symmetric"
},
{
"c_v": 0.3831423298202148,
"u_mass": -10.444572234830176,
"num_topics": 6,
"model_name": "m2symmetric"
},
{
"c_v": 0.39275418605457174,
"u_mass": -10.966134341161546,
"num_topics": 7,
"model_name": "m2symmetric"
},
{
"c_v": 0.381967137683177,
"u_mass": -10.783802298760884,
"num_topics": 8,
"model_name": "m2symmetric"
},
{
"c_v": 0.4439532208641127,
"u_mass": -9.328938035061189,
"num_topics": 9,
"model_name": "m2symmetric"
},
{
"c_v": 0.4376289532725616,
"u_mass": -8.590293326724703,
"num_topics": 10,
"model_name": "m2symmetric"
},
{
"c_v": 0.44261714398157187,
"u_mass": -9.495062422041947,
"num_topics": 11,
"model_name": "m2symmetric"
},
{
"c_v": 0.4427348574778822,
"u_mass": -9.518891333080983,
"num_topics": 12,
"model_name": "m2symmetric"
},
{
"c_v": 0.43781909595097984,
"u_mass": -10.292743356000715,
"num_topics": 13,
"model_name": "m2symmetric"
},
{
"c_v": 0.45417133033561863,
"u_mass": -9.246960743062944,
"num_topics": 14,
"model_name": "m2symmetric"
},
{
"c_v": 0.44749543796309943,
"u_mass": -10.569365170122463,
"num_topics": 15,
"model_name": "m2symmetric"
},
{
"c_v": 0.4475468001065708,
"u_mass": -9.960549842786438,
"num_topics": 16,
"model_name": "m2symmetric"
},
{
"c_v": 0.46235372345763986,
"u_mass": -11.405710356220414,
"num_topics": 17,
"model_name": "m2symmetric"
},
{
"c_v": 0.41741578136666263,
"u_mass": -11.787557070777229,
"num_topics": 18,
"model_name": "m2symmetric"
},
{
"c_v": 0.4368215794672795,
"u_mass": -11.478840397137002,
"num_topics": 19,
"model_name": "m2symmetric"
},
{
"c_v": 0.42682633109961066,
"u_mass": -10.523431479242472,
"num_topics": 20,
"model_name": "m2symmetric"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment