Skip to content

feat: add one-hot data preprocessing#46

Merged
Yanyan-Wang merged 1 commit intomasterfrom
feat/add-one-hot
Dec 30, 2021
Merged

feat: add one-hot data preprocessing#46
Yanyan-Wang merged 1 commit intomasterfrom
feat/add-one-hot

Conversation

@xdddst
Copy link
Copy Markdown
Member

@xdddst xdddst commented Dec 29, 2021

用于i-louvain、nodes-cosine-similarity等算法的节点属性特征向量提取
之前只抽取了数值型和日期型的属性做运算
one-hot可以处理所有离散型的数据提取映射成特征向量

@xdddst xdddst force-pushed the feat/add-one-hot branch 2 times, most recently from 77da8ad to 6f091eb Compare December 29, 2021 07:58
dataList.forEach(data => {
keys = keys.concat(Object.keys(data));
})
keys = Array.from(new Set(keys));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
})
if (value.length) {
allKeyValueMap[key] = Array.from(new Set(value));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

allKeyValueMap[key] = Array.from(new Set(value));
}
})
delete allKeyValueMap['id'];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有没有可能让用户传入一些字段名字,用来排除计算。或者说传入一些字段名字,用于计算相似性

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好建议,已经加上extractKeys和noExtractKeys,用于指定仅计算哪些属性或排除计算哪些属性

@xdddst xdddst force-pushed the feat/add-one-hot branch 2 times, most recently from 73ba18a to 741c5f9 Compare December 30, 2021 03:49
chore: perf code

chore: perf code

chore: perf code

feat: 数据预处理支持指定要抽取的keys和不抽取的keys

chore: perf code

chore: perf code
@Yanyan-Wang Yanyan-Wang merged commit 544a1c3 into master Dec 30, 2021
@Yanyan-Wang Yanyan-Wang deleted the feat/add-one-hot branch December 30, 2021 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants