修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

v5.0
搜索
    v5.0

      Struc2Vec游走

      HDC

      概述

      Struc2Vec游走是一种有偏的随机游走(Biased Random Walk)。这是Struc2Vec框架的关键组成部分之一,其中游走是在构建的带权多层图中而不是在原图中进行的。详情请参考Struc2Vec算法。

      示例图集

      创建示例图集:

      // 在空图集中逐行运行以下语句
      insert().into(@default).nodes([{_id:"A"},{_id:"B"},{_id:"C"},{_id:"D"},{_id:"E"},{_id:"F"},{_id:"G"},{_id:"H"},{_id:"I"},{_id:"J"}])
      insert().into(@default).edges([{_from:"A", _to:"B"}, {_from:"A", _to:"C"}, {_from:"D", _to:"C"}, {_from:"D", _to:"F"}, {_from:"E", _to:"C"}, {_from:"E", _to:"F"}, {_from:"F", _to:"G"}, {_from:"G", _to:"J"}, {_from:"H", _to:"G"}, {_from:"H", _to:"I"}])
      

      创建HDC图集

      将当前图集全部加载到HDC服务器hdc-server-1上,并命名为 hdc_struc2vec_walk

      CALL hdc.graph.create("hdc-server-1", "hdc_struc2vec_walk", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "undirected",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      })
      

      hdc.graph.create("hdc_struc2vec_walk", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "undirected",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      }).to("hdc-server-1")
      

      参数

      算法名:random_walk_struc2vec

      参数名
      类型
      规范
      默认值
      可选
      描述
      ids []_id / / 通过_id指定随机游走的起点;若未设置则计算所有点
      uuids []_uuid / / 通过_uuid指定随机游走的起点;若未设置则计算所有点
      walk_length Integer ≥1 1 每次游走的深度,即访问的节点数量
      walk_num Integer ≥1 1 从每个指定节点开始的游走次数
      k Integer [1, 10] / 构建的多层加权图中的层数,层数不能超过原始图的直径
      stay_probability Float (0,1] / 留在当前层游走的概率
      return_id_uuid String uuid, id, both uuid 在结果中使用_uuid_id或同时使用两者来表示点
      limit Integer ≥-1 -1 限制返回的结果数;-1返回所有结果

      文件回写

      CALL algo.random_walk_struc2vec.write("hdc_struc2vec_walk", {
        params: {
          return_id_uuid: "id",
          walk_length: 5,
          walk_num: 1,
          k: 4,
          stay_probability: 0.8
        },
        return_params: {
          file: {
            filename: "walks"
          }
        }
      })
      

      algo(random_walk_struc2vec).params({
        project: "hdc_struc2vec_walk",
        return_id_uuid: "id",
        walk_length: 5,
        walk_num: 1,
        k: 4,
        stay_probability: 0.8
      }).write({
        file:{
          filename: 'walks'
      }})
      

      结果:

      _ids
      J,G,F,E,C,
      D,F,E,F,E,
      F,G,F,
      H,I,H,F,
      B,A,B,A,B,
      A,C,E,D,
      E,F,G,H,G,
      C,D,F,G,
      I,H,G,F,E,
      G,D,F,
      

      完整返回

      CALL algo.random_walk_struc2vec("hdc_struc2vec_walk", {
        params: {
          return_id_uuid: "id",
          ids: ['J'],
          walk_length: 6,
          walk_num: 3,
          k: 4,
          stay_probability: 0.8
        },
        return_params: {}
      }) YIELD walks
      RETURN walks
      

      exec{
        algo(random_walk_struc2vec).params({
          return_id_uuid: "id",
          ids: ['J'],
          walk_length: 6,
          walk_num: 3,
          k: 4,
          stay_probability: 0.8
        }) as walks
        return walks
      } on hdc_struc2vec_walk
      

      结果:

      _ids
      ["J","G","F","C","B"]
      ["J","F","H","F","J"]
      ["J","G","J","H","F"]

      流式返回

      CALL algo.random_walk_struc2vec("hdc_struc2vec_walk", {
        params: {
          return_id_uuid: "id",
          ids: ['J'],
          walk_length: 6,
          walk_num: 3,
          k: 5,
          stay_probability: 0.7
        },
        return_params: {
          stream: {}
        }
      }) YIELD walks
      RETURN walks
      

      exec{
        algo(random_walk_struc2vec).params({
          return_id_uuid: "id",
          ids: ['J'],
          walk_length: 6,
          walk_num: 3,
          k: 5,
          stay_probability: 0.7
        }).stream() as walks
        return walks
      } on hdc_struc2vec_walk
      

      结果:

      _ids
      ["J","G","I","F"]
      ["J","E","J"]
      ["J","H","F","A"]
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写