File tree 2 files changed +11
-4
lines changed
scala/src/main/scala/de/gwdg/metadataqa/marc/spark
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 100
100
done
101
101
done
102
102
103
- for TYPE in " density" " clustering-coefficient" ; do
103
+ for TYPE in " density" " clustering-coefficient" " triCountGraph-stat " ; do
104
104
# PREFIX=density
105
105
if [[ $TAG == " all" && -e $OUTPUT_DIR /network-scores-${TYPE} .csv ]]; then
106
106
rm $OUTPUT_DIR /network-scores-${TYPE} .csv
111
111
| grep -v -P " ^\d+,average-clustering-coefficient$" \
112
112
| sed ' s/all,average-clustering-coefficient/tag,average-clustering-coefficient/' \
113
113
>> $OUTPUT_DIR /network-scores-${TYPE} .csv
114
- # rm $OUTPUT_DIR/network-scores-$TAG-${TYPE}.csv
114
+ rm $OUTPUT_DIR /network-scores-$TAG -${TYPE} .csv
115
115
done
116
116
done < $INPUT_DIR /network-by-concepts-tags.csv
Original file line number Diff line number Diff line change @@ -181,10 +181,16 @@ object Network {
181
181
log.info(" STEP 5: clustering coefficients" )
182
182
183
183
val triCountGraph = graph.triangleCount()
184
- // triCountGraph.vertices.map(x => x._2).stats()
185
- val tricountDF = triCountGraph.vertices.toDF(" id" , " count" )
184
+ val triCountGraphstat = triCountGraph.vertices
185
+ .map(x => x._2)
186
+ .toDF(" x" )
187
+ .select(" x" )
188
+ .summary().toDF(" statistic" , " value" )
189
+ this .write(" network-scores" + suffix + " -triCountGraph-stat" , triCountGraphstat)
190
+ // val tricountDF = triCountGraph.vertices.toDF("id", "count")
186
191
187
192
// var degreesRDD = graph.degrees.cache()
193
+ /*
188
194
val maxTrisGraph = graph.degrees.mapValues(d => d * (d - 1) / 2.0)
189
195
val maxTrisDF = maxTrisGraph.toDF("id", "theoreticalMax")
190
196
@@ -199,6 +205,7 @@ object Network {
199
205
200
206
val dataDF = Seq(arageClusteringCoefficient).toDF("average-clustering-coefficient")
201
207
this.write("network-scores" + suffix + "-clustering-coefficient", dataDF)
208
+ */
202
209
}
203
210
204
211
def write (file : String , df : DataFrame ): Unit = {
You can’t perform that action at this time.
0 commit comments