@@ -540,6 +540,79 @@ function eval_SC_loose(SChat, SC, k, data, target_col; digits=4)
540
540
round (correct / total, digits= digits)
541
541
end
542
542
543
+
544
+ """
545
+ eval_SC_loose(SChat, SC, SC_rest, k; digits=4)
546
+
547
+ Assess model accuracy on the basis of the correlations of row vectors of Chat and
548
+ C or Shat and S. Count it as correct if one of the top k candidates is correct.
549
+ Does not consider homophones.
550
+ Takes into account gold-standard vectors in both the actual targets (SC)
551
+ as well as in a second matrix (e.g. the training or validation data; SC_rest).
552
+
553
+ # Obligatory Arguments
554
+ - `SChat::Union{SparseMatrixCSC, Matrix}`: the Chat or Shat matrix
555
+ - `SC::Union{SparseMatrixCSC, Matrix}`: the C or S matrix of the data under consideration
556
+ - `SC_rest::Union{SparseMatrixCSC, Matrix}`: the C or S matrix of rest data
557
+ - `k`: top k candidates
558
+
559
+ # Optional Arguments
560
+ - `digits=4`: the specified number of digits after the decimal place (or before if negative)
561
+
562
+ ```julia
563
+ eval_SC_loose(Chat_val, cue_obj_val.C, cue_obj_train.C, k)
564
+ eval_SC_loose(Shat_val, S_val, S_train, k)
565
+ ```
566
+ """
567
+ function eval_SC_loose (SChat, SC, SC_rest, k; digits= 4 )
568
+ SC_combined = vcat (SC, SC_rest)
569
+ eval_SC_loose (SChat, SC_combined, k, digits= digits)
570
+ end
571
+
572
+ """
573
+ eval_SC_loose(SChat, SC, SC_rest, k, data, data_rest, target_col; digits=4)
574
+
575
+ Assess model accuracy on the basis of the correlations of row vectors of Chat and
576
+ C or Shat and S. Count it as correct if one of the top k candidates is correct.
577
+ Considers homophones.
578
+ Takes into account gold-standard vectors in both the actual targets (SC)
579
+ as well as in a second matrix (e.g. the training or validation data; SC_rest).
580
+
581
+ # Obligatory Arguments
582
+ - `SChat::Union{SparseMatrixCSC, Matrix}`: the Chat or Shat matrix
583
+ - `SC::Union{SparseMatrixCSC, Matrix}`: the C or S matrix of the data under consideration
584
+ - `SC_rest::Union{SparseMatrixCSC, Matrix}`: the C or S matrix of rest data
585
+ - `k`: top k candidates
586
+ - `data`: dataset under consideration
587
+ - `data_rest`: remaining dataset
588
+ - `target_col`: target column name
589
+
590
+ # Optional Arguments
591
+ - `digits=4`: the specified number of digits after the decimal place (or before if negative)
592
+
593
+ ```julia
594
+ eval_SC_loose(Chat_val, cue_obj_val.C, cue_obj_train.C, k, latin_val, latin_train, :Word)
595
+ eval_SC_loose(Shat_val, S_val, S_train, k, latin_val, latin_train, :Word)
596
+ ```
597
+ """
598
+ function eval_SC_loose (SChat, SC, SC_rest, k, data, data_rest, target_col; digits= 4 )
599
+ SC_combined = vcat (SC, SC_rest)
600
+
601
+ n_data = size (data, 1 )
602
+ n_data_rest = size (data_rest, 1 )
603
+
604
+ if n_data > n_data_rest
605
+ data_combined = similar (data, 0 )
606
+ else
607
+ data_combined = similar (data_rest, 0 )
608
+ end
609
+
610
+ append! (data_combined, data)
611
+ append! (data_combined, data_rest)
612
+
613
+ eval_SC_loose (SChat, SC_combined, k, data_combined, target_col, digits= digits)
614
+ end
615
+
543
616
"""
544
617
eval_manual(res, data, i2f)
545
618
0 commit comments