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
152 changed files
with
4,146 additions
and
2,904 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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'package:benchmark_harness/benchmark_harness.dart'; | ||
import 'package:ml_algo/ml_algo.dart'; | ||
import 'package:ml_dataframe/ml_dataframe.dart'; | ||
import 'package:ml_linalg/matrix.dart'; | ||
import 'package:ml_linalg/vector.dart'; | ||
|
||
const observationsNum = 200; | ||
const featuresNum = 20; | ||
|
||
class LinearRegressorBenchmark extends BenchmarkBase { | ||
LinearRegressorBenchmark() : super('Linear regressor'); | ||
|
||
DataFrame fittingData; | ||
|
||
static void main() { | ||
LinearRegressorBenchmark().report(); | ||
} | ||
|
||
@override | ||
void run() { | ||
LinearRegressor(fittingData, 'col_20'); | ||
} | ||
|
||
@override | ||
void setup() { | ||
final features = Matrix.fromRows(List.generate(observationsNum, | ||
(i) => Vector.randomFilled(featuresNum))); | ||
|
||
final labels = Matrix.fromColumns([Vector.randomFilled(observationsNum)]); | ||
|
||
fittingData = DataFrame.fromMatrix( | ||
Matrix.fromColumns([ | ||
...features.columns, | ||
...labels.columns, | ||
]), | ||
); | ||
} | ||
|
||
void tearDown() {} | ||
} | ||
|
||
Future main() async { | ||
LinearRegressorBenchmark.main(); | ||
} |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
import 'package:benchmark_harness/benchmark_harness.dart'; | ||
import 'package:ml_algo/ml_algo.dart'; | ||
import 'package:ml_dataframe/ml_dataframe.dart'; | ||
import 'package:ml_linalg/matrix.dart'; | ||
import 'package:ml_linalg/vector.dart'; | ||
|
||
const observationsNum = 200; | ||
const columnsNum = 21; | ||
|
||
class LogisticRegressorBenchmark extends BenchmarkBase { | ||
LogisticRegressorBenchmark() : super('Logistic regressor'); | ||
|
||
DataFrame _data; | ||
|
||
static void main() { | ||
LogisticRegressorBenchmark().report(); | ||
} | ||
|
||
@override | ||
void run() { | ||
LogisticRegressor( | ||
_data, | ||
'col_20', | ||
minCoefficientsUpdate: null, | ||
iterationsLimit: 200, | ||
); | ||
} | ||
|
||
@override | ||
void setup() { | ||
final Matrix observations = Matrix.fromRows(List.generate(observationsNum, | ||
(i) => Vector.randomFilled(columnsNum))); | ||
|
||
_data = DataFrame.fromMatrix(observations); | ||
} | ||
|
||
void tearDown() {} | ||
} | ||
|
||
Future main() async { | ||
LogisticRegressorBenchmark.main(); | ||
} |
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 |
---|---|---|
@@ -1,12 +1,10 @@ | ||
import 'dart:async'; | ||
|
||
import 'gradient_descent_regression.dart' as gradientDescentRegressionBenchmark; | ||
import 'logistic_regression.dart' as logisticRegressionBenchmark; | ||
import 'algorithms/knn.dart' as knnBenchmark; | ||
import 'linear_regressor.dart' as gradient_descent_regression_benchmark; | ||
import 'logistic_regressor.dart' as logistic_regression_benchmark; | ||
import 'algorithms/knn.dart' as knn_regressor_benchmark; | ||
|
||
Future main() async { | ||
// (MacBook Air mid 2017) | ||
await gradientDescentRegressionBenchmark.main(); // 0.07 sec | ||
await logisticRegressionBenchmark.main(); // 0.12 sec | ||
await knnBenchmark.main(); // 5 sec | ||
await gradient_descent_regression_benchmark.main(); // 0.07 sec | ||
await logistic_regression_benchmark.main(); // 0.12 sec | ||
await knn_regressor_benchmark.main(); // 5 sec | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
export 'package:ml_algo/src/algorithms/knn/kernel_type.dart'; | ||
export 'package:ml_algo/src/classifier/linear/logistic_regressor/logistic_regressor.dart'; | ||
export 'package:ml_algo/src/classifier/linear/softmax_regressor/softmax_regressor.dart'; | ||
export 'package:ml_algo/src/classifier/decision_tree_classifier.dart'; | ||
export 'package:ml_algo/src/classifier/logistic_regressor.dart'; | ||
export 'package:ml_algo/src/classifier/softmax_regressor.dart'; | ||
export 'package:ml_algo/src/linear_optimizer/gradient_optimizer/learning_rate_generator/learning_rate_type.dart'; | ||
export 'package:ml_algo/src/linear_optimizer/linear_optimizer_type.dart'; | ||
export 'package:ml_algo/src/linear_optimizer/regularization_type.dart'; | ||
export 'package:ml_algo/src/metric/classification/type.dart'; | ||
export 'package:ml_algo/src/metric/metric_type.dart'; | ||
export 'package:ml_algo/src/metric/regression/type.dart'; | ||
export 'package:ml_algo/src/model_selection/cross_validator/cross_validator.dart'; | ||
export 'package:ml_algo/src/regressor/knn_regressor.dart'; | ||
export 'package:ml_algo/src/regressor/linear_regressor.dart'; | ||
export 'package:ml_algo/src/regressor/parameterless_regressor.dart'; | ||
export 'package:ml_algo/src/solver/linear/gradient/learning_rate_generator/learning_rate_type.dart'; |
Oops, something went wrong.