2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
// See the LICENSE file in the project root for more information.
4
4
5
+ using System ;
5
6
using System . Globalization ;
6
7
using System . Linq ;
7
8
using System . Threading ;
@@ -105,6 +106,7 @@ private void Context_Log(object sender, LoggingEventArgs e)
105
106
}
106
107
107
108
[ Theory ]
109
+ [ Trait ( "Category" , "RunSpecificTest" ) ]
108
110
[ InlineData ( "en-US" ) ]
109
111
[ InlineData ( "ar-SA" ) ]
110
112
[ InlineData ( "pl-PL" ) ]
@@ -113,7 +115,7 @@ public void AutoFitRegressionTest(string culture)
113
115
var originalCulture = Thread . CurrentThread . CurrentCulture ;
114
116
Thread . CurrentThread . CurrentCulture = new CultureInfo ( culture ) ;
115
117
116
- uint experimentTime = 0 ;
118
+ uint experimentTime = 30 ;
117
119
118
120
if ( culture == "ar-SA" )
119
121
{
@@ -132,6 +134,7 @@ public void AutoFitRegressionTest(string culture)
132
134
}
133
135
134
136
var context = new MLContext ( 1 ) ;
137
+ context . Log += ( sender , e ) => Console . WriteLine ( e ) ; //MYTODO: added for debugging purposes
135
138
var dataPath = DatasetUtil . GetMlNetGeneratedRegressionDataset ( ) ;
136
139
var columnInference = context . Auto ( ) . InferColumns ( dataPath , DatasetUtil . MlNetGeneratedRegressionLabel ) ;
137
140
var textLoader = context . Data . CreateTextLoader ( columnInference . TextLoaderOptions ) ;
@@ -143,8 +146,14 @@ public void AutoFitRegressionTest(string culture)
143
146
. Execute ( trainData , validationData ,
144
147
new ColumnInformation ( ) { LabelColumnName = DatasetUtil . MlNetGeneratedRegressionLabel } ) ;
145
148
149
+ //var trainers = Enum.GetValues(typeof(RegressionTrainer)).OfType<RegressionTrainer>().ToList();
150
+
146
151
//MYTODO: Only adding this for debugging purposes on the CI:
147
- System . Console . WriteLine ( $ "culture:{ culture } - Count: { result . RunDetails . Count ( ) } - Null ValidationMetrics Count:{ result . RunDetails . Where ( rd => rd . ValidationMetrics == null ) . Count ( ) } ") ;
152
+ var nullValidationMetrics = result . RunDetails . Where ( rd => rd . ValidationMetrics == null ) . ToArray ( ) ;
153
+ System . Console . WriteLine ( $ "culture:{ culture } - Count: { result . RunDetails . Count ( ) } - Null ValidationMetrics Count:{ nullValidationMetrics . Count ( ) } ") ;
154
+ if ( nullValidationMetrics . Count ( ) > 0 )
155
+ for ( var i = 0 ; i < nullValidationMetrics . Count ( ) ; i ++ )
156
+ Console . WriteLine ( $ "nullValidationMetrics[{ i } ].TrainerName={ nullValidationMetrics [ i ] . TrainerName } ") ;
148
157
149
158
Assert . True ( result . RunDetails . Max ( i => i . ValidationMetrics . RSquared > 0.9 ) ) ;
150
159
0 commit comments