Skip to content

Commit 4c4fa43

Browse files
authored
README.md: example for flutter developers added (#170)
1 parent a9c744f commit 4c4fa43

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 15.6.1
4+
- README.md: example for flutter developers added
5+
36
## 15.6.0
47
- Models retraining functionality added
58

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For more information on the library's API, please visit [API reference](https://
5252
Let's classify records from well-known dataset - [Pima Indians Diabets Database](https://www.kaggle.com/uciml/pima-indians-diabetes-database)
5353
via [Logistic regressor](https://github.com/gyrdym/ml_algo/blob/master/lib/src/classifier/logistic_regressor/logistic_regressor.dart)
5454

55-
Import all necessary packages. First, it's needed to ensure, if you have `ml_preprocessing` and `ml_dataframe` package
55+
Import all necessary packages. First, it's needed to ensure if you have `ml_preprocessing` and `ml_dataframe` packages
5656
in your dependencies:
5757

5858
````
@@ -77,8 +77,28 @@ read it (of course, you should provide a proper path to your downloaded file):
7777
final samples = await fromCsv('datasets/pima_indians_diabetes_database.csv', headerExists: true);
7878
````
7979

80-
*For flutter developers: please, read the official flutter.dev article [Read and write files](https://flutter.dev/docs/cookbook/persistence/reading-writing-files)
81-
before manipulating with file system in order to build a correct path to your dataset*
80+
#### For flutter developers
81+
82+
*Please, read the official flutter.dev article [Read and write files](https://flutter.dev/docs/cookbook/persistence/reading-writing-files)
83+
before manipulating with the file system in order to build a correct path to your dataset.*
84+
85+
*Generally, you need to add `path_provider`
86+
package to your dependencies:*
87+
88+
````
89+
dependencies:
90+
path_provider: ^1.6.24 # or find the actual version of the lib
91+
````
92+
93+
*After that you need to write the following code (some parts of the code can be altered depending on the details of your app):*
94+
95+
```dart
96+
import 'package:path_provider/path_provider.dart';
97+
98+
final directory = await getApplicationDocumentsDirectory(); // getApplicationDocumentsDirectory is a function from `path_provider` package
99+
final filePath = `${directory.path}/assets/pima_indians_diabetes_database.csv`;
100+
final samples = await fromCsv(filePath, headerExists: true);
101+
```
82102

83103
Data in this file is represented by 768 records and 8 features. 9th column is a label column, it contains either 0 or 1
84104
on each row. This column is our target - we should predict a class label for each observation. The column's name is

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: ml_algo
22
description: Machine learning algorithms, Machine learning models performance evaluation functionality
3-
version: 15.6.0
3+
version: 15.6.1
44
homepage: https://github.com/gyrdym/ml_algo
55

66
environment:

0 commit comments

Comments
 (0)