This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Embedding後のデータを読み込む | |
df_first <- read.csv('tmp/emb_first', header=FALSE, sep=' ', stringsAsFactors = FALSE) | |
df_second <- read.csv('tmp/emb_second', header=FALSE, sep=' ', stringsAsFactors = FALSE) | |
# アイテム名の抽出。first, secondともに同じ順番n | |
names <- df_first[2:nrow(df_first),1] | |
# Embedding部分のconcat | |
emb_first <- matrix(unlist(df_first[2:nrow(df_first),2:33]), nrow=nrow(df_first)-1, ncol=32) | |
emb_second <- matrix(unlist(df_second[2:nrow(df_second),2:33]), nrow=nrow(df_second)-1, ncol=32) | |
embs <- cbind(emb_first, emb_second) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(network) | |
df <- read.csv('tmp/op_net.csv', header=FALSE, sep=' ', stringsAsFactors = FALSE) | |
df <- df[2:nrow(df),] | |
num_edges <- nrow(df) | |
edgelist <- matrix("",nrow= num_edges,ncol = 2) | |
for(i in 1:num_edges){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cloud ML Engine用のディレクトリを一発で作成するためのシェル | |
function ConfirmProjectName(){ | |
echo "本当にカレントディレクトリに作成して良いですか? ? (y/n)" | |
read input | |
if [ $input = 'NO' ] || [ $input = 'No' ] || [ $input = 'no' ] || [ $input = 'N' ] || [ $input = 'n' ] ; then | |
echo "作成したいディレクトリへ移動してください" | |
exit | |
elif [ $input = 'YES' ] || [ $input = 'Yes' ] || [ $input = 'yes' ] || [ $input = 'Y' ] || [ $input = 'y' ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function AskProjectName() { | |
echo "プロジェクトディレクトリを作成しますか?(y/n)" | |
read input | |
if [ $input = 'YES' ] || [ $input = 'Yes' ] || [ $input = 'yes' ] || [ $input = 'Y' ] || [ $input = 'y' ] ; then | |
InputName | |
ConfirmInput | |
dirname=$projectname |