Skip to content

Instantly share code, notes, and snippets.

@allwefantasy
Created July 27, 2016 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save allwefantasy/2170f67c9e1e453604e2e76923ee65dc to your computer and use it in GitHub Desktop.
Save allwefantasy/2170f67c9e1e453604e2e76923ee65dc to your computer and use it in GitHub Desktop.
机器学习模型训练
{
"als_training": {
"desc": "测试",
"strategy": "streaming.core.strategy.SparkStreamingStrategy",
"algorithm": [],
"ref": [],
"compositor": [
{
"name": "streaming.core.compositor.spark.source.MockJsonCompositor",
"params": [
{
"a": "http://123.com/path?userId=1&itemId=2"
},
{
"a": "http://123.com/path?userId=2&itemId=3"
},
{
"a": "http://123.com/path?userId=2&itemId=2"
},
{
"a": "http://123.com/path?userId=3&itemId=2"
}
]
},
{
"name": "streaming.core.compositor.spark.transformation.JSONTableCompositor",
"params": [
{
"tableName": "test"
}
]
},
{
"name": "streaming.core.compositor.spark.transformation.SQLCompositor",
"params": [
{
"sql": [
"select",
"split(split(split(a,'\\?')[1],'&')[0],'=')[1] as user, ",
"split(split(split(a,'\\?')[1],'&')[1],'=')[1] as item,",
"split(split(split(a,'\\?')[1],'&')[0],'=')[1] as label,",
"'1.0' as rating",
"from test"
],
"outputTableName":"test2"
}
]
},
{
"name": "streaming.core.compositor.spark.transformation.SQLCompositor",
"params": [
{
"sql": [
"select",
"concat_ws(',',user,item,rating) as features,",
"label",
"from test2"
]
}
]
},
{
"name": "streaming.core.compositor.spark.output.AlgorithmOutputCompositor",
"params": [
{
"path": "/tmp/als_log",
"algorithm": "als"
},
{
"rank": 10,
"alpha": 1.0
}
]
}
],
"configParams": {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment