From 4c273126fc7f9c6e5f4ca95fd8b5d188dd48df74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 15 Jan 2025 12:36:41 +0100 Subject: [PATCH 1/2] Update CI --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00bbc1e3..d536e1e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ jobs: fail-fast: false matrix: include: - - elixir: "1.15.6" - otp: "26.1" + - elixir: "1.18.1" + otp: "27.1" lint: true - - elixir: "1.14.5" + - elixir: "1.15.8" otp: "26.1" steps: - uses: actions/checkout@v2 From 94870163f8eb0738ebfcc24f8b3a51c107f2146e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 15 Jan 2025 12:41:03 +0100 Subject: [PATCH 2/2] mix format --- test/scholar/neighbors/knn_regressor_test.exs | 26 +++++++++++++++++-- test/scholar/neighbors/rnn_regressor_test.exs | 13 +++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/test/scholar/neighbors/knn_regressor_test.exs b/test/scholar/neighbors/knn_regressor_test.exs index 5707ac9a..ec3d0d56 100644 --- a/test/scholar/neighbors/knn_regressor_test.exs +++ b/test/scholar/neighbors/knn_regressor_test.exs @@ -93,7 +93,18 @@ defmodule Scholar.Neighbors.KNNRegressorTest do test "predict with 2D labels" do y = - Nx.tensor([[1, 4], [0, 3], [2, 5], [0, 3], [0, 3], [1, 4], [2, 5], [0, 3], [1, 4], [2, 5]]) + Nx.tensor([ + [1, 4], + [0, 3], + [2, 5], + [0, 3], + [0, 3], + [1, 4], + [2, 5], + [0, 3], + [1, 4], + [2, 5] + ]) model = KNNRegressor.fit(x_train(), y, num_neighbors: 3) y_pred = KNNRegressor.predict(model, x()) @@ -111,7 +122,18 @@ defmodule Scholar.Neighbors.KNNRegressorTest do test "predict with 2D labels, cosine metric and weights set to :distance" do y = - Nx.tensor([[1, 4], [0, 3], [2, 5], [0, 3], [0, 3], [1, 4], [2, 5], [0, 3], [1, 4], [2, 5]]) + Nx.tensor([ + [1, 4], + [0, 3], + [2, 5], + [0, 3], + [0, 3], + [1, 4], + [2, 5], + [0, 3], + [1, 4], + [2, 5] + ]) model = KNNRegressor.fit(x_train(), y, num_neighbors: 3, metric: :cosine, weights: :distance) diff --git a/test/scholar/neighbors/rnn_regressor_test.exs b/test/scholar/neighbors/rnn_regressor_test.exs index 38be8798..3e69c823 100644 --- a/test/scholar/neighbors/rnn_regressor_test.exs +++ b/test/scholar/neighbors/rnn_regressor_test.exs @@ -54,7 +54,18 @@ defmodule Scholar.Neighbors.RadiusNNRegressorTest do test "predict with weights set to :distance and with specific metric and 2d labels" do y = - Nx.tensor([[1, 4], [0, 3], [2, 5], [0, 3], [0, 3], [1, 4], [2, 5], [0, 3], [1, 4], [2, 5]]) + Nx.tensor([ + [1, 4], + [0, 3], + [2, 5], + [0, 3], + [0, 3], + [1, 4], + [2, 5], + [0, 3], + [1, 4], + [2, 5] + ]) model = RadiusNNRegressor.fit(x(), y,