Skip to content

Instantly share code, notes, and snippets.

View ra312's full-sized avatar
🎯
Focusing

ra312 ra312

🎯
Focusing
View GitHub Profile
@ra312
ra312 / test_hyperopt_sampling.py
Last active April 26, 2020 13:30
hyperopt:generate mixed samples
from hyperopt import hp
from hyperopt.pyll.stochastic import sample
space = hp.choice('label', [
hp.uniform('sub_label_1', 0.3, 0.8),
hp.normal('sub_label_2', 0.5, 1.0), None, 0, 1, "anything"
])
space = {
# None by default
'max_depth': hp.choice('max_depth', [None, np.arange(1, 300, 1,dtype=int)]),
# 2 by default
from azureml.core import Workspace, Environment
from azureml.core.conda_dependencies import CondaDependencies
from azureml.core import Image
ws = Workspace.from_config()
env = Environment(name = 'myenv')
conda_dep = CondaDependencies()
# Installs numpy version 1.17.0 conda package
conda_deps = ['blas=1.0',
@ra312
ra312 / s4di_ch01_exercises.sc
Created June 18, 2019 09:13 — forked from parambirs/s4di_ch01_exercises.sc
Solutions for "Scala for the Impatient", chapter 1 exercises
package src.exercises
import scala.math._
import BigInt.probablePrime
import util.Random
object chap01 {
// 1. In the Scala REPL, type 3. followed by the Tab key. What methods can be
// applied?
// => Do it in REPL. There are many methods including %, &, *, +, toByte, toChar etc.