@@ -21,17 +21,17 @@ public enum TaskType
21
21
/// </summary>
22
22
internal class TaskAgnosticAutoFit
23
23
{
24
- private TaskType taskType ;
25
- private MLContext context ;
24
+ private TaskType _taskType ;
25
+ private MLContext _context ;
26
26
27
27
internal interface IUniversalProgressHandler : IProgress < RunDetail < RegressionMetrics > > , IProgress < RunDetail < MulticlassClassificationMetrics > >
28
28
{
29
29
}
30
30
31
31
internal TaskAgnosticAutoFit ( TaskType taskType , MLContext context )
32
32
{
33
- this . taskType = taskType ;
34
- this . context = context ;
33
+ this . _taskType = taskType ;
34
+ this . _context = context ;
35
35
}
36
36
37
37
internal IEnumerable < TaskAgnosticIterationResult > AutoFit (
@@ -46,7 +46,7 @@ internal IEnumerable<TaskAgnosticIterationResult> AutoFit(
46
46
{
47
47
var columnInformation = new ColumnInformation ( ) { LabelColumnName = label } ;
48
48
49
- switch ( this . taskType )
49
+ switch ( this . _taskType )
50
50
{
51
51
case TaskType . Classification :
52
52
@@ -58,7 +58,7 @@ internal IEnumerable<TaskAgnosticIterationResult> AutoFit(
58
58
MaxModels = maxModels
59
59
} ;
60
60
61
- var classificationResult = this . context . Auto ( )
61
+ var classificationResult = this . _context . Auto ( )
62
62
. CreateMulticlassClassificationExperiment ( mcs )
63
63
. Execute (
64
64
trainData ,
@@ -80,7 +80,7 @@ internal IEnumerable<TaskAgnosticIterationResult> AutoFit(
80
80
MaxModels = maxModels
81
81
} ;
82
82
83
- var regressionResult = this . context . Auto ( )
83
+ var regressionResult = this . _context . Auto ( )
84
84
. CreateRegressionExperiment ( rs )
85
85
. Execute (
86
86
trainData ,
@@ -102,7 +102,7 @@ internal IEnumerable<TaskAgnosticIterationResult> AutoFit(
102
102
MaxModels = maxModels
103
103
} ;
104
104
105
- var recommendationResult = this . context . Auto ( )
105
+ var recommendationResult = this . _context . Auto ( )
106
106
. CreateRecommendationExperiment ( recommendationSettings )
107
107
. Execute (
108
108
trainData ,
@@ -115,7 +115,7 @@ internal IEnumerable<TaskAgnosticIterationResult> AutoFit(
115
115
return iterationResults ;
116
116
117
117
default :
118
- throw new ArgumentException ( $ "Unknown task type { this . taskType } .", "TaskType" ) ;
118
+ throw new ArgumentException ( $ "Unknown task type { this . _taskType } .", "TaskType" ) ;
119
119
}
120
120
}
121
121
@@ -135,11 +135,11 @@ internal ScoreResult Score(
135
135
136
136
result . ScoredTestData = model . Transform ( testData ) ;
137
137
138
- switch ( this . taskType )
138
+ switch ( this . _taskType )
139
139
{
140
140
case TaskType . Classification :
141
141
142
- var classificationMetrics = context . MulticlassClassification . Evaluate ( result . ScoredTestData , labelColumnName : label ) ;
142
+ var classificationMetrics = _context . MulticlassClassification . Evaluate ( result . ScoredTestData , labelColumnName : label ) ;
143
143
144
144
//var classificationMetrics = context.MulticlassClassification.(scoredTestData, labelColumnName: label);
145
145
result . PrimaryMetricResult = classificationMetrics . MicroAccuracy ; // TODO: don't hardcode metric
@@ -149,15 +149,15 @@ internal ScoreResult Score(
149
149
150
150
case TaskType . Regression :
151
151
152
- var regressionMetrics = context . Regression . Evaluate ( result . ScoredTestData , labelColumnName : label ) ;
152
+ var regressionMetrics = _context . Regression . Evaluate ( result . ScoredTestData , labelColumnName : label ) ;
153
153
154
154
result . PrimaryMetricResult = regressionMetrics . RSquared ; // TODO: don't hardcode metric
155
155
result . Metrics = TaskAgnosticIterationResult . MetricValuesToDictionary ( regressionMetrics ) ;
156
156
157
157
break ;
158
158
159
159
default :
160
- throw new ArgumentException ( $ "Unknown task type { this . taskType } .", "TaskType" ) ;
160
+ throw new ArgumentException ( $ "Unknown task type { this . _taskType } .", "TaskType" ) ;
161
161
}
162
162
163
163
return result ;
0 commit comments