Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
153 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
lib/src/model_selection/data_splitter/data_splitter_factory.dart
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
lib/src/model_selection/data_splitter/data_splitter_factory_impl.dart
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
lib/src/model_selection/data_splitter/data_splitter_type.dart
This file was deleted.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
...n/data_splitter/k_fold_data_splitter.dart → ...ndices_provider/k_fold_data_splitter.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
lib/src/model_selection/split_indices_provider/split_indices_provider.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
abstract class SplitIndicesProvider { | ||
Iterable<Iterable<int>> getIndices(int numberOfSamples); | ||
} |
9 changes: 9 additions & 0 deletions
9
lib/src/model_selection/split_indices_provider/split_indices_provider_factory.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/split_indices_provider_type.dart'; | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/split_indices_provider.dart'; | ||
|
||
abstract class SplitIndicesProviderFactory { | ||
SplitIndicesProvider createByType(SplitIndicesProviderType splitterType, { | ||
int numberOfFolds, | ||
int p, | ||
}); | ||
} |
34 changes: 34 additions & 0 deletions
34
lib/src/model_selection/split_indices_provider/split_indices_provider_factory_impl.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/split_indices_provider_factory.dart'; | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/split_indices_provider_type.dart'; | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/k_fold_data_splitter.dart'; | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/lpo_indices_provider.dart'; | ||
import 'package:ml_algo/src/model_selection/split_indices_provider/split_indices_provider.dart'; | ||
|
||
class SplitIndicesProviderFactoryImpl implements SplitIndicesProviderFactory { | ||
const SplitIndicesProviderFactoryImpl(); | ||
|
||
@override | ||
SplitIndicesProvider createByType(SplitIndicesProviderType splitterType, { | ||
int numberOfFolds, | ||
int p, | ||
}) { | ||
switch (splitterType) { | ||
case SplitIndicesProviderType.kFold: | ||
if (numberOfFolds == null) { | ||
throw Exception('Number of folds is not defined for K-fold splitter'); | ||
} | ||
return KFoldIndicesProvider(numberOfFolds); | ||
|
||
case SplitIndicesProviderType.lpo: | ||
if (p == null) { | ||
throw Exception('`p` parameter is not defined for leave-p-out ' | ||
'splitter'); | ||
} | ||
return LpoIndicesProvider(p); | ||
|
||
default: | ||
throw UnimplementedError('Splitter of type $splitterType is not ' | ||
'implemented yet'); | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
lib/src/model_selection/split_indices_provider/split_indices_provider_type.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
enum SplitIndicesProviderType { | ||
lpo, kFold, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.