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
import numpy as np | |
class LogisticRegressionGradientDescent: | |
def __init__(self, eta=0.05, n_iter=100, random_state=1): | |
self.eta = eta | |
self.n_iter = n_iter | |
self.random_state = random_state | |
def fit(self, X, y): |
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
import numpy as np | |
class Perceptron: | |
def __init__(self, eta=0.01, n_iter=50, random_state=1): | |
""" | |
eta: 学習率 | |
n_iter: 学習を繰り返す回数 | |
""" | |
self.eta = eta |
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
import numpy as np | |
class AdalineByGradinentDescent: | |
def __init__(self, eta=0.01, n_iter=10, random_state=1): | |
""" | |
eta: 学習率 | |
n_iter: 学習を反復する回数 | |
""" | |
self.eta = eta |
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
pipeline :browser do | |
plug :accepts, ["html"] | |
plug :fetch_session | |
plug :fetch_flash | |
plug :protect_from_forgery | |
plug :put_secure_browser_headers | |
plug :set_log1_file_daily | |
plug :set_log2_file_daily | |
end | |
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
# Configures backend :log1 | |
config :logger, :log1, | |
path: Path.join([File.cwd!, "var", "log", "log1.log"]), | |
level: :info, | |
metadata_filter: [type: :log1] | |
# Configures backend :log2 | |
config :logger, :log2, | |
path: Path.join([File.cwd!, "var", "log", "log2.log"]), | |
level: :debug, |
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
# Configures backend :log1 | |
config :logger, :log1, | |
path: Path.join([File.cwd!, "var", "log", "log1.log"]), | |
level: :info | |
# Configures backend :log2 | |
config :logger, :log2, | |
path: Path.join([File.cwd!, "var", "log", "log2.log"]), | |
level: :debug |
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
# Configures logger_file_backend | |
config :logger, | |
backends: [:console, {LoggerFileBackend, :log1}, {LoggerFileBackend, :log2}] |
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
defp deps do | |
[ | |
{:logger_file_backend, "~> 0.0.10"} | |
] | |
end |
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
const arr = [1,2,3,4,5]; |
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
function sumOfArray(arr, sum = 0){ | |
if(arr.lenth === 0) return sum; | |
else{ | |
const [first, ...rest] = arr; | |
return sumOfArray(rest, first + sum); | |
} | |
} |
NewerOlder