Skip to content

Commit 0377a65

Browse files
authored
More strict analyser options added (#171)
1 parent 4c4fa43 commit 0377a65

File tree

9 files changed

+22
-10
lines changed

9 files changed

+22
-10
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.2
4+
- More strict analyser options added
5+
36
## 15.6.1
47
- README.md: example for flutter developers added
58

analysis_options.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
include: package:pedantic/analysis_options.yaml
2+
3+
analyzer:
4+
strong-mode:
5+
implicit-casts: false
6+
implicit-dynamic: true
7+
errors:
8+
missing_return: error
9+
dead_code: error
10+
duplicate_import: error

lib/src/classifier/logistic_regressor/logistic_regressor_impl.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ class LogisticRegressorImpl
255255
iterationsLimit: iterationsLimit,
256256
initialLearningRate: initialLearningRate,
257257
minCoefficientsUpdate: minCoefficientsUpdate,
258-
probabilityThreshold: probabilityThreshold,
258+
probabilityThreshold: probabilityThreshold?.toDouble(),
259259
lambda: lambda,
260260
regularizationType: regularizationType,
261261
randomSeed: randomSeed,
262262
batchSize: batchSize,
263263
fitIntercept: fitIntercept,
264-
interceptScale: interceptScale,
264+
interceptScale: interceptScale?.toDouble(),
265265
isFittingDataNormalized: isFittingDataNormalized,
266266
learningRateType: learningRateType,
267267
initialCoefficientsType: initialCoefficientsType,

lib/src/classifier/softmax_regressor/softmax_regressor_factory.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:ml_linalg/matrix.dart';
1010
abstract class SoftmaxRegressorFactory {
1111
SoftmaxRegressor create({
1212
DataFrame trainData,
13-
List<String> targetNames,
13+
Iterable<String> targetNames,
1414
LinearOptimizerType optimizerType,
1515
int iterationsLimit,
1616
double initialLearningRate,

lib/src/classifier/softmax_regressor/softmax_regressor_factory_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class SoftmaxRegressorFactoryImpl implements SoftmaxRegressorFactory {
2222
@override
2323
SoftmaxRegressor create({
2424
DataFrame trainData,
25-
List<String> targetNames,
25+
Iterable<String> targetNames,
2626
LinearOptimizerType optimizerType = LinearOptimizerType.gradient,
2727
int iterationsLimit = 100,
2828
double initialLearningRate = 1e-3,

lib/src/classifier/softmax_regressor/softmax_regressor_impl.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class SoftmaxRegressorImpl
251251
randomSeed: randomSeed,
252252
batchSize: batchSize,
253253
fitIntercept: fitIntercept,
254-
interceptScale: interceptScale,
254+
interceptScale: interceptScale?.toDouble(),
255255
learningRateType: learningRateType,
256256
isFittingDataNormalized: isFittingDataNormalized,
257257
initialCoefficientsType: initialCoefficientsType,

lib/src/regressor/linear_regressor/linear_regressor_impl.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ class LinearRegressorImpl
203203
iterationsLimit: iterationsLimit,
204204
learningRateType: learningRateType,
205205
initialCoefficientsType: initialCoefficientsType,
206-
initialLearningRate: initialLearningRate,
207-
minCoefficientsUpdate: minCoefficientsUpdate,
208-
lambda: lambda,
206+
initialLearningRate: initialLearningRate?.toDouble(),
207+
minCoefficientsUpdate: minCoefficientsUpdate?.toDouble(),
208+
lambda: lambda?.toDouble(),
209209
regularizationType: regularizationType,
210210
fitIntercept: fitIntercept,
211211
interceptScale: interceptScale,

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.1
3+
version: 15.6.2
44
homepage: https://github.com/gyrdym/ml_algo
55

66
environment:

test/classifier/logistic_regressor/integration_test/logistic_regressor_serialization_integration_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void main() {
5959
int iterationsLimit = 2,
6060
double minCoefficientsUpdate = 1e-12,
6161
double initialLearningRate = 1.0,
62-
num lambda,
62+
double lambda,
6363
RegularizationType regularizationType,
6464
int randomSeed,
6565
int batchSize = 5,

0 commit comments

Comments
 (0)