Skip to content

Commit

Permalink
e2e tests task added
Browse files Browse the repository at this point in the history
  • Loading branch information
gyrdym committed Sep 8, 2020
1 parent 3ecc80a commit 8fc4145
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -4,10 +4,11 @@
- Breaking changes:
- `CrossValidator`:
- `targetNames` argument removed
- returning type changed to Future<Vector> (previous one was `double`)
- `Assessable`, `assess` method: `targetNames` argument removed
- Precision metric added
- Coordinate descent optimization logic fixed: dtype considered
- `LinearClassifier`:
- `classNames` property replaced with `targetNames` property in `Predictor`

## 14.2.6
- `injector` lib 1.0.9 supported
Expand Down
22 changes: 11 additions & 11 deletions README.md
Expand Up @@ -57,8 +57,8 @@ in your dependencies:

````
dependencies:
ml_dataframe: ^0.1.1
ml_preprocessing: ^5.1.0
ml_dataframe: ^0.2.0
ml_preprocessing: ^5.2.0
````

We need these repos to parse raw data in order to use it farther. For more details, please
Expand Down Expand Up @@ -103,18 +103,18 @@ final testData = splits[1];
data as a validation set and 30% as a test set for evaluating generalization error.

Then we may create an instance of `CrossValidator` class to fit [hyperparameters](https://en.wikipedia.org/wiki/Hyperparameter_(machine_learning))
of our model. We should pass validation data (our `validationData` variable), a list of target column names (in our case it's
just a name stored in `targetColumnName` variable) and a number of folds into CrossValidator constructor.
of our model. We should pass validation data (our `validationData` variable), and a number of folds into CrossValidator
constructor.

````dart
final validator = CrossValidator.kFold(validationData, [targetColumnName], numberOfFolds: 5);
final validator = CrossValidator.kFold(validationData, numberOfFolds: 5);
````

Let's create a factory for the classifier with desired hyperparameters. We have to decide after the cross validation,
if the selected hyperparametrs are good enough or not:

```dart
final createClassifier = (DataFrame samples, _) =>
final createClassifier = (DataFrame samples) =>
LogisticRegressor(
samples
targetColumnName,
Expand All @@ -141,7 +141,7 @@ If we want to evaluate the learning process more thoroughly, we may pass `collec
constructor:

```dart
final createClassifier = (DataFrame samples, _) =>
final createClassifier = (DataFrame samples) =>
LogisticRegressor(
...,
collectLearningData: true,
Expand Down Expand Up @@ -180,8 +180,8 @@ Let's assess our hyperparameters on test set in order to evaluate the model's ge

```dart
final testSplits = splitData(testData, [0.8]);
final classifier = createClassifier(testSplits[0], targetNames);
final finalScore = classifier.assess(testSplits[1], targetNames, MetricType.accuracy);
final classifier = createClassifier(testSplits[0]);
final finalScore = classifier.assess(testSplits[1], MetricType.accuracy);
```

The final score is like:
Expand Down Expand Up @@ -239,8 +239,8 @@ void main() async {
final splits = splitData(samples, [0.7]);
final validationData = splits[0];
final testData = splits[1];
final validator = CrossValidator.kFold(validationData, [targetColumnName], numberOfFolds: 5);
final createClassifier = (DataFrame samples, _) =>
final validator = CrossValidator.kFold(validationData, numberOfFolds: 5);
final createClassifier = (DataFrame samples) =>
LogisticRegressor(
samples
targetColumnName,
Expand Down

0 comments on commit 8fc4145

Please sign in to comment.