Skip to content

Commit

Permalink
Cross validator entity: evaluate method now returns Future<Vector> in…
Browse files Browse the repository at this point in the history
…stead of double
  • Loading branch information
gyrdym committed Jun 21, 2020
1 parent 5826a62 commit 3c1e3cc
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions README.md
Expand Up @@ -102,13 +102,10 @@ final scores = await validator.evaluate((samples, targetNames) =>
LogisticRegressor(
samples,
targetNames[0], // remember, we provided a list of just a single name
optimizerType: LinearOptimizerType.gradient,
initialLearningRate: .8,
iterationsLimit: 500,
batchSize: samples.rows.length,
fitIntercept: true,
interceptScale: .1,
learningRateType: LearningRateType.constant
optimizerType: LinearOptimizerType.gradient,
learningRateType: LearningRateType.decreasingAdaptive,
probabilityThreshold: 0.7,
randomSeed: 3,
), MetricType.accuracy);
````

Expand All @@ -127,7 +124,7 @@ print('accuracy on classification: ${accuracy.toStringAsFixed(2)}');
We will see something like this:

````
acuracy on classification: 0.77
acuracy on classification: 0.65
````

All the code above all together:
Expand All @@ -145,13 +142,10 @@ Future main() async {
LogisticRegressor(
samples,
targetNames[0], // remember, we provide a list of just a single name
optimizerType: LinearOptimizerType.gradient,
initialLearningRate: .8,
iterationsLimit: 500,
batchSize: 768,
fitIntercept: true,
interceptScale: .1,
learningRateType: LearningRateType.constant
optimizerType: LinearOptimizerType.gradient,
learningRateType: LearningRateType.decreasingAdaptive,
probabilityThreshold: 0.7,
randomSeed: 3,
), MetricType.accuracy);
final accuracy = scores.mean();
Expand Down

0 comments on commit 3c1e3cc

Please sign in to comment.