@@ -25,8 +25,10 @@ public class BigramAndTrigramBenchmark
2525 private string _dataPath_Wiki ;
2626 private string _modelPath_Wiki ;
2727
28- [ GlobalSetup ( Targets = new string [ ] { nameof ( Preceptron_CV ) , nameof ( LightGBM_CV ) } ) ]
29- public void Setup_Preceptron_LightGBM ( )
28+ [ GlobalSetup ( Targets = new string [ ] {
29+ nameof ( CV_Multiclass_WikiDetox_BigramsAndTrichar_OVAAveragedPerceptron ) ,
30+ nameof ( CV_Multiclass_WikiDetox_BigramsAndTrichar_LightGBMMulticlass ) } ) ]
31+ public void SetupTrainingSpeedTests ( )
3032 {
3133 _dataPath_Wiki = Path . GetFullPath ( TestDatasets . WikiDetox . trainFilename ) ;
3234
@@ -36,10 +38,10 @@ public void Setup_Preceptron_LightGBM()
3638 }
3739 }
3840
39- [ GlobalSetup ( Target = nameof ( WikiDetox ) ) ]
40- public void Setup_WikiDetox ( )
41+ [ GlobalSetup ( Target = nameof ( Test_Multiclass_WikiDetox_BigramsAndTrichar_OVAAveragedPerceptron ) ) ]
42+ public void SetupScoringSpeedTests ( )
4143 {
42- Setup_Preceptron_LightGBM ( ) ;
44+ SetupTrainingSpeedTests ( ) ;
4345 _modelPath_Wiki = Path . Combine ( Directory . GetCurrentDirectory ( ) , @"WikiModel.zip" ) ;
4446 string cmd = @"CV k=5 data=" + _dataPath_Wiki + " loader=TextLoader{quote=- sparse=- col=Label:R4:0 col=rev_id:TX:1 col=comment:TX:2 col=logged_in:BL:4 col=ns:TX:5 col=sample:TX:6 col=split:TX:7 col=year:R4:3 header=+} xf=Convert{col=logged_in type=R4} xf=CategoricalTransform{col=ns} xf=TextTransform{col=FeaturesText:comment wordExtractor=NGramExtractorTransform{ngram=2}} xf=Concat{col=Features:FeaturesText,logged_in,ns} tr=OVA{p=AveragedPerceptron{iter=10}} out={" + _modelPath_Wiki + "}" ;
4547 using ( var tlc = new TlcEnvironment ( verbose : false , sensitivity : MessageSensitivity . None , outWriter : EmptyWriter . Instance ) )
@@ -49,7 +51,7 @@ public void Setup_WikiDetox()
4951 }
5052
5153 [ Benchmark ]
52- public void Preceptron_CV ( )
54+ public void CV_Multiclass_WikiDetox_BigramsAndTrichar_OVAAveragedPerceptron ( )
5355 {
5456 string cmd = @"CV k=5 data=" + _dataPath_Wiki + " loader=TextLoader{quote=- sparse=- col=Label:R4:0 col=rev_id:TX:1 col=comment:TX:2 col=logged_in:BL:4 col=ns:TX:5 col=sample:TX:6 col=split:TX:7 col=year:R4:3 header=+} xf=Convert{col=logged_in type=R4} xf=CategoricalTransform{col=ns} xf=TextTransform{col=FeaturesText:comment wordExtractor=NGramExtractorTransform{ngram=2}} xf=Concat{col=Features:FeaturesText,logged_in,ns} tr=OVA{p=AveragedPerceptron{iter=10}}" ;
5557 using ( var tlc = new TlcEnvironment ( verbose : false , sensitivity : MessageSensitivity . None , outWriter : EmptyWriter . Instance ) )
@@ -59,7 +61,7 @@ public void Preceptron_CV()
5961 }
6062
6163 [ Benchmark ]
62- public void LightGBM_CV ( )
64+ public void CV_Multiclass_WikiDetox_BigramsAndTrichar_LightGBMMulticlass ( )
6365 {
6466 string cmd = @"CV k=5 data=" + _dataPath_Wiki + " loader=TextLoader{quote=- sparse=- col=Label:R4:0 col=rev_id:TX:1 col=comment:TX:2 col=logged_in:BL:4 col=ns:TX:5 col=sample:TX:6 col=split:TX:7 col=year:R4:3 header=+} xf=Convert{col=logged_in type=R4} xf=CategoricalTransform{col=ns} xf=TextTransform{col=FeaturesText:comment wordExtractor=NGramExtractorTransform{ngram=2}} xf=Concat{col=Features:FeaturesText,logged_in,ns} tr=LightGBMMulticlass{}" ;
6567 using ( var tlc = new TlcEnvironment ( verbose : false , sensitivity : MessageSensitivity . None , outWriter : EmptyWriter . Instance ) )
@@ -69,8 +71,9 @@ public void LightGBM_CV()
6971 }
7072
7173 [ Benchmark ]
72- public void WikiDetox ( )
74+ public void Test_Multiclass_WikiDetox_BigramsAndTrichar_OVAAveragedPerceptron ( )
7375 {
76+ // This benchmark is profiling bulk scoring speed and not training speed.
7477 string modelpath = Path . Combine ( Directory . GetCurrentDirectory ( ) , @"WikiModel.fold000.zip" ) ;
7578 string cmd = @"Test data=" + _dataPath_Wiki + " in=" + modelpath ;
7679 using ( var tlc = new TlcEnvironment ( verbose : false , sensitivity : MessageSensitivity . None , outWriter : EmptyWriter . Instance ) )
0 commit comments