You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ We have 2 options here:
121
121
122
122
- Download the dataset from [Pima Indians Diabetes Database](https://www.kaggle.com/uciml/pima-indians-diabetes-database).
123
123
124
-
- Or we may simply use [loadPimaIndiansDiabetesDataset](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/loadPimaIndiansDiabetesDataset.html) function
124
+
- Or we may simply use [getPimaIndiansDiabetesDataFrame](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/getPimaIndiansDiabetesDataFrame.html) function
125
125
from [ml_dataframe](https://pub.dev/packages/ml_dataframe) package. The function returns a ready to use [DataFrame](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/DataFrame-class.html) instance
126
126
filled with `Pima Indians Diabetes Database` data.
final rawCsvContent = await rootBundle.loadString('assets/datasets/pima_indians_diabetes_database.csv');
389
389
// Another option - to use a toy dataset:
390
-
// final samples = await loadPimaIndiansDiabetesDataset();
390
+
// final samples = getPimaIndiansDiabetesDataFrame();
391
391
final samples = DataFrame.fromRawCsv(rawCsvContent);
392
392
final targetColumnName = 'Outcome';
393
393
final splits = splitData(samples, [0.7]);
@@ -599,7 +599,7 @@ void main() async {
599
599
Let's try to classify data from a well-known [Iris](https://www.kaggle.com/datasets/uciml/iris) dataset using a non-linear algorithm - [decision trees](https://en.wikipedia.org/wiki/Decision_tree)
600
600
601
601
First, you need to download the data and place it in a proper place in your file system. To do so you should follow the
602
-
instructions which are given in the [Logistic regression](#logistic-regression) section. Or you may use [loadIrisDataset](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/loadIrisDataset.html)
602
+
instructions which are given in the [Logistic regression](#logistic-regression) section. Or you may use [getIrisDataFrame](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/getIrisDataFrame.html)
603
603
function that returns ready to use [DataFrame](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/DataFrame-class.html) instance filled with `Iris`dataset.
604
604
605
605
After loading the data, it's needed to preprocess it. We should drop the `Id` column since the column doesn't make sense.
Let's retrieve some data points through a kd-tree built on the [Iris](https://www.kaggle.com/datasets/uciml/iris) dataset.
676
676
677
677
First, we need to prepare the data. To do so, it's needed to load the dataset. For this purpose, we may use
678
-
[loadIrisDataset](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/loadIrisDataset.html) function from [ml_dataframe](https://pub.dev/packages/ml_dataframe). The function returns prefilled with the Iris data DataFrame instance:
678
+
[getIrisDataFrame](https://pub.dev/documentation/ml_dataframe/latest/ml_dataframe/getIrisDataFrame.html) function from [ml_dataframe](https://pub.dev/packages/ml_dataframe). The function returns prefilled with the Iris data DataFrame instance:
679
679
680
680
```dart
681
681
import 'package:ml_algo/ml_algo.dart';
682
682
import 'package:ml_dataframe/ml_dataframe.dart';
683
683
684
-
void main() async {
685
-
final originalData = await loadIrisDataset();
684
+
void main() {
685
+
final originalData = getIrisDataFrame();
686
686
}
687
687
```
688
688
@@ -693,8 +693,8 @@ drop these columns:
693
693
import 'package:ml_algo/ml_algo.dart';
694
694
import 'package:ml_dataframe/ml_dataframe.dart';
695
695
696
-
void main() async {
697
-
final originalData = await loadIrisDataset();
696
+
void main() {
697
+
final originalData = getIrisDataFrame();
698
698
final data = originalData.dropSeries(names: ['Id', 'Species']);
699
699
}
700
700
```
@@ -705,8 +705,8 @@ Next, we can build the tree:
705
705
import 'package:ml_algo/ml_algo.dart';
706
706
import 'package:ml_dataframe/ml_dataframe.dart';
707
707
708
-
void main() async {
709
-
final originalData = await loadIrisDataset();
708
+
void main() {
709
+
final originalData = getIrisDataFrame();
710
710
final data = originalData.dropSeries(names: ['Id', 'Species']);
0 commit comments