Skip to content

Commit

Permalink
ml_dataframe 0.3.0 supported, github actions set up
Browse files Browse the repository at this point in the history
  • Loading branch information
gyrdym committed Dec 17, 2020
1 parent e908546 commit c6f3e50
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 31 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci_pipeline.yml
@@ -0,0 +1,37 @@
name: CI pipeline

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

container:
image: google/dart:latest

steps:
- uses: actions/checkout@v2

- name: Print Dart SDK version
run: dart --version

- name: Install dependencies
run: dart pub get

- name: Analyze project source
run: dart analyze --fatal-infos

- name: Run tests
run: dart test

- name: Code coverage
run: dart pub run test_coverage

- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog

## 5.2.1
- `ml_dataframe`: version 0.3.0 supported
- `CI`: github actions set up

## 5.2.0
- `UnknownValueHandlingType` enum added to the lib's public API

Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.com/gyrdym/ml_algo.svg?branch=master)](https://travis-ci.com/gyrdym/ml_preprocessing)
[![Build Status](https://github.com/gyrdym/ml_preprocessing/workflows/CI%20pipeline/badge.svg)](https://github.com/gyrdym/ml_preprocessing/actions?query=branch%3Amaster+)
[![Coverage Status](https://coveralls.io/repos/github/gyrdym/ml_preprocessing/badge.svg)](https://coveralls.io/github/gyrdym/ml_preprocessing)
[![pub package](https://img.shields.io/pub/v/ml_preprocessing.svg)](https://pub.dartlang.org/packages/ml_preprocessing)
[![Gitter Chat](https://badges.gitter.im/gyrdym/gyrdym.svg)](https://gitter.im/gyrdym/)
Expand Down Expand Up @@ -194,4 +194,4 @@ final processed = pipeline.process(dataFrame);

`encodeAsOneHotLabels`, `encodeAsIntegerLabels`, `normalize` and `standardize` are pipeable operator functions.
Pipeable operator function is a factory, that takes fitting data and creates a fitted pipeable entity (e.g.,
`Normalizer` instance)
`Normalizer` instance)
2 changes: 1 addition & 1 deletion analysis_options.yaml
@@ -1 +1 @@
include: package:ml_tech/analysis_options.yaml
include: package:pedantic/analysis_options.yaml
4 changes: 2 additions & 2 deletions lib/src/encoder/helpers/create_encoder_to_series_mapping.dart
Expand Up @@ -6,7 +6,7 @@ Map<String, SeriesEncoder> createEncoderToSeriesMapping(
DataFrame dataFrame,
Iterable<String> predefinedSeriesNames,
Iterable<int> seriesIndices,
SeriesEncoder seriesEncoderFactory(Series series),
SeriesEncoder Function(Series series) seriesEncoderFactory,
) {
final seriesNames = predefinedSeriesNames ??
getSeriesNamesByIndices(dataFrame.header, seriesIndices);
Expand All @@ -16,4 +16,4 @@ Map<String, SeriesEncoder> createEncoderToSeriesMapping(
return MapEntry(name, encoder);
});
return Map.fromEntries(entries);
}
}
8 changes: 4 additions & 4 deletions pubspec.yaml
@@ -1,22 +1,22 @@
name: ml_preprocessing
description: Popular algorithms of data preprocessing for machine learning
version: 5.2.0
version: 5.2.1
author: Ilia Gyrdymov <ilgyrd@gmail.com>
homepage: https://github.com/gyrdym/ml_preprocessing

environment:
sdk: '>=2.7.0 <3.0.0'

dependencies:
ml_dataframe: ^0.2.0
ml_dataframe: ^0.3.0
ml_linalg: ^12.17.0
quiver: ^2.0.2

dev_dependencies:
benchmark_harness: '>=1.0.0 <2.0.0'
build_runner: ^1.1.2
build_test: ^0.10.2
grinder: ^0.8.3
ml_tech: ^0.0.5
mockito: ^3.0.0
pedantic: ^1.9.2
test: ^1.2.0
test_coverage: ^0.5.0
24 changes: 24 additions & 0 deletions test/helpers.dart
@@ -0,0 +1,24 @@
import 'package:test/test.dart';

Matcher iterable2dAlmostEqualTo(Iterable<Iterable<double>> expected,
[double precision = 1e-5]) =>
pairwiseCompare<Iterable<double>, Iterable<double>>(expected,
(Iterable<double> expected, Iterable<double> actual) {
if (expected.length != actual.length) {
return false;
}
for (var i = 0; i < expected.length; i++) {
if ((expected.elementAt(i) - actual.elementAt(i)).abs() >= precision) {
return false;
}
}
return true;
}, '');

Matcher iterableAlmostEqualTo(Iterable<double> expected,
[double precision = 1e-5]) =>
pairwiseCompare<double, double>(
expected,
(expectedVal, actualVal) =>
(expectedVal - actualVal).abs() <= precision,
'');
3 changes: 2 additions & 1 deletion test/normalizer/normalizer_test.dart
@@ -1,9 +1,10 @@
import 'package:ml_dataframe/ml_dataframe.dart';
import 'package:ml_linalg/linalg.dart';
import 'package:ml_preprocessing/src/normalizer/normalizer.dart';
import 'package:ml_tech/unit_testing/matchers/iterable_2d_almost_equal_to.dart';
import 'package:test/test.dart';

import '../helpers.dart';

void main() {
group('Normalizer', () {
test('should divide each row-vector by its euclidean norm and preserve '
Expand Down
3 changes: 2 additions & 1 deletion test/standardizer/standardizer_test.dart
Expand Up @@ -2,9 +2,10 @@ import 'package:ml_dataframe/ml_dataframe.dart';
import 'package:ml_linalg/dtype.dart';
import 'package:ml_linalg/linalg.dart';
import 'package:ml_preprocessing/ml_preprocessing.dart';
import 'package:ml_tech/unit_testing/matchers/iterable_2d_almost_equal_to.dart';
import 'package:test/test.dart';

import '../helpers.dart';

void main() {
const dtype = DType.float32;

Expand Down
15 changes: 0 additions & 15 deletions tool/grind.dart

This file was deleted.

0 comments on commit c6f3e50

Please sign in to comment.