A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/tidymodels/parsnip/commit/897c92719332caf7344e7c9c8895ac673517d2c8 below:

fix some parameter mappings between parsnip and the underlying model … · tidymodels/parsnip@897c927 · GitHub

File tree Expand file treeCollapse file tree 7 files changed

+33

-24

lines changed

Filter options

Expand file treeCollapse file tree 7 files changed

+33

-24

lines changed Original file line number Diff line number Diff line change

@@ -309,7 +309,7 @@ set_model_arg(

309 309

model = "boost_tree",

310 310

eng = "spark",

311 311

parsnip = "min_info_gain",

312 -

original = "gamma",

312 +

original = "loss_reduction",

313 313

func = list(pkg = "dials", fun = "loss_reduction"),

314 314

has_submodel = FALSE

315 315

)

Original file line number Diff line number Diff line change

@@ -342,6 +342,15 @@ set_model_engine("linear_reg", "regression", "keras")

342 342

set_dependency("linear_reg", "keras", "keras")

343 343

set_dependency("linear_reg", "keras", "magrittr")

344 344 345 +

set_model_arg(

346 +

model = "linear_reg",

347 +

eng = "keras",

348 +

parsnip = "penalty",

349 +

original = "penalty",

350 +

func = list(pkg = "dials", fun = "penalty"),

351 +

has_submodel = FALSE

352 +

)

353 + 345 354

set_fit(

346 355

model = "linear_reg",

347 356

eng = "keras",

Original file line number Diff line number Diff line change

@@ -288,9 +288,9 @@ set_dependency("logistic_reg", "keras", "magrittr")

288 288

set_model_arg(

289 289

model = "logistic_reg",

290 290

eng = "keras",

291 -

parsnip = "decay",

292 -

original = "decay",

293 -

func = list(pkg = "dials", fun = "weight_decay"),

291 +

parsnip = "penalty",

292 +

original = "penalty",

293 +

func = list(pkg = "dials", fun = "penalty"),

294 294

has_submodel = FALSE

295 295

)

296 296 Original file line number Diff line number Diff line change

@@ -265,12 +265,12 @@ class2ind <- function (x, drop2nd = FALSE) {

265 265

#' @param x A data frame or matrix of predictors

266 266

#' @param y A vector (factor or numeric) or matrix (numeric) of outcome data.

267 267

#' @param hidden_units An integer for the number of hidden units.

268 -

#' @param decay A non-negative real number for the amount of weight decay. Either

268 +

#' @param penalty A non-negative real number for the amount of weight decay. Either

269 269

#' this parameter _or_ `dropout` can specified.

270 270

#' @param dropout The proportion of parameters to set to zero. Either

271 -

#' this parameter _or_ `decay` can specified.

271 +

#' this parameter _or_ `penalty` can specified.

272 272

#' @param epochs An integer for the number of passes through the data.

273 -

#' @param act A character string for the type of activation function between layers.

273 +

#' @param activation A character string for the type of activation function between layers.

274 274

#' @param seeds A vector of three positive integers to control randomness of the

275 275

#' calculations.

276 276

#' @param ... Currently ignored.

@@ -279,11 +279,11 @@ class2ind <- function (x, drop2nd = FALSE) {

279 279

#' @export

280 280

keras_mlp <-

281 281

function(x, y,

282 -

hidden_units = 5, decay = 0, dropout = 0, epochs = 20, act = "softmax",

282 +

hidden_units = 5, penalty = 0, dropout = 0, epochs = 20, activation = "softmax",

283 283

seeds = sample.int(10^5, size = 3),

284 284

...) {

285 285 286 -

if (decay > 0 & dropout > 0) {

286 +

if (penalty > 0 & dropout > 0) {

287 287

stop("Please use either dropoput or weight decay.", call. = FALSE)

288 288

}

289 289

if (!is.matrix(x)) {

@@ -307,20 +307,20 @@ keras_mlp <-

307 307 308 308

model <- keras::keras_model_sequential()

309 309 310 -

if (decay > 0) {

310 +

if (penalty > 0) {

311 311

model %>%

312 312

keras::layer_dense(

313 313

units = hidden_units,

314 -

activation = act,

314 +

activation = activation,

315 315

input_shape = ncol(x),

316 -

kernel_regularizer = keras::regularizer_l2(decay),

316 +

kernel_regularizer = keras::regularizer_l2(penalty),

317 317

kernel_initializer = keras::initializer_glorot_uniform(seed = seeds[1])

318 318

)

319 319

} else {

320 320

model %>%

321 321

keras::layer_dense(

322 322

units = hidden_units,

323 -

activation = act,

323 +

activation = activation,

324 324

input_shape = ncol(x),

325 325

kernel_initializer = keras::initializer_glorot_uniform(seed = seeds[1])

326 326

)

@@ -330,7 +330,7 @@ keras_mlp <-

330 330

model %>%

331 331

keras::layer_dense(

332 332

units = hidden_units,

333 -

activation = act,

333 +

activation = activation,

334 334

input_shape = ncol(x),

335 335

kernel_initializer = keras::initializer_glorot_uniform(seed = seeds[1])

336 336

) %>%

Original file line number Diff line number Diff line change

@@ -24,7 +24,7 @@ set_model_arg(

24 24

eng = "keras",

25 25

parsnip = "penalty",

26 26

original = "penalty",

27 -

func = list(pkg = "dials", fun = "weight_decay"),

27 +

func = list(pkg = "dials", fun = "penalty"),

28 28

has_submodel = FALSE

29 29

)

30 30

set_model_arg(

@@ -188,7 +188,7 @@ set_model_arg(

188 188

eng = "nnet",

189 189

parsnip = "penalty",

190 190

original = "decay",

191 -

func = list(pkg = "dials", fun = "weight_decay"),

191 +

func = list(pkg = "dials", fun = "penalty"),

192 192

has_submodel = FALSE

193 193

)

194 194

set_model_arg(

Original file line number Diff line number Diff line change

@@ -172,9 +172,9 @@ set_dependency("multinom_reg", "keras", "magrittr")

172 172

set_model_arg(

173 173

model = "multinom_reg",

174 174

eng = "keras",

175 -

parsnip = "decay",

176 -

original = "decay",

177 -

func = list(pkg = "dials", fun = "weight_decay"),

175 +

parsnip = "penalty",

176 +

original = "penalty",

177 +

func = list(pkg = "dials", fun = "penalty"),

178 178

has_submodel = FALSE

179 179

)

180 180

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4