Skip to content

Commit 20515b8

Browse files
authored
Set 'fitIntercept' param to 'true' by default (#234)
1 parent cdfe598 commit 20515b8

File tree

10 files changed

+13
-8
lines changed

10 files changed

+13
-8
lines changed

CHANGELOG.md

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

3+
## 16.15.2
4+
- LinearRegressor, LogisticRegressor, SoftmaxRegressor:
5+
- Set `fitIntercept` param to `true` by default
6+
37
## 16.15.1
48
- README: LogisticRegressor example corrected
59

Lines changed: 1 addition & 1 deletion
Loading

e2e/decision_tree_classifier/pima_indians_tree.svg

Lines changed: 1 addition & 1 deletion
Loading

lib/src/classifier/logistic_regressor/logistic_regressor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ abstract class LogisticRegressor
398398
/// coefficients, that is also bad.
399399
///
400400
/// [fitIntercept] Whether or not to fit intercept term. Default value is
401-
/// `false`. Intercept in 2-dimensional space is a bias of the line (relative
401+
/// `true`. Intercept in 2-dimensional space is a bias of the line (relative
402402
/// to X-axis).
403403
///
404404
/// [interceptScale] A value, defining a size of the intercept.

lib/src/classifier/softmax_regressor/softmax_regressor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ abstract class SoftmaxRegressor
9393
/// mode will be activated.
9494
///
9595
/// [fitIntercept] Whether or not to fit intercept term. Default value is
96-
/// `false`. Intercept in 2-dimensional space is a bias of the line (relative
96+
/// `true`. Intercept in 2-dimensional space is a bias of the line (relative
9797
/// to X-axis) to be learned by the classifier.
9898
///
9999
/// [interceptScale] A value defining a size of the intercept.

lib/src/common/constants/default_parameters/linear_optimization.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import 'package:ml_algo/src/linear_optimizer/linear_optimizer_type.dart';
33

44
const initialCoefficientsTypeDefaultValue = InitialCoefficientsType.zeroes;
55
const linearOptimizerTypeDefaultValue = LinearOptimizerType.gradient;
6-
const fitInterceptDefaultValue = false;
6+
const fitInterceptDefaultValue = true;
77
const interceptScaleDefaultValue = 1.0;

lib/src/regressor/linear_regressor/linear_regressor.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ abstract class LinearRegressor
193193
/// The greater the value of [lambda], the stricter feature selection is.
194194
///
195195
/// [fitIntercept] Whether or not to fit intercept term. Default value is
196-
/// `false`. Intercept in 2-dimensional space is a bias of the line (relative
196+
/// `true`. Intercept in 2-dimensional space is a bias of the line (relative
197197
/// to X-axis).
198198
///
199199
/// [interceptScale] A value defining a size of the intercept.

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

66
environment:

test/classifier/logistic_regressor/integration_test/logistic_regressor_fitting_integration_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ void main() {
327327
batchSize: 3,
328328
dtype: DType.float32,
329329
collectLearningData: true,
330+
fitIntercept: false,
330331
iterationsLimit: 3);
331332

332333
expect(classifier.costPerIteration, [

test/regressor/linear_regressor/linear_regressor_closed_form_integration_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void main() {
1111
[5.5, 5, 20],
1212
[5.25, 5, 22],
1313
]);
14-
final regressor = LinearRegressor(data, targetName);
14+
final regressor = LinearRegressor(data, targetName, fitIntercept: false);
1515
final dataToPredict = [
1616
[5, 25.0]
1717
];

0 commit comments

Comments
 (0)