摘要: In [22]: y_true = [[0], [1]] In [23]: y_pred = [[0.9], [0.9]] In [24]: tf.keras.losses.binary_crossentropy(y_true, y_pred) Out[24]: <tf.Tensor: shape= 阅读全文
posted @ 2020-11-21 17:26 2021年的顺遂平安君 阅读(1860) 评论(0) 推荐(0) 编辑
摘要: relig_income #> # A tibble: 18 x 11 #> religion `<$10k` `$10-20k` `$20-30k` `$30-40k` `$40-50k` `$50-75k` `$75-100k` #> <chr> <dbl> <dbl> <dbl> <dbl> 阅读全文
posted @ 2020-11-21 17:23 2021年的顺遂平安君 阅读(885) 评论(0) 推荐(0) 编辑
摘要: find . -type f -iname \*.jpg -delete -type 文件类型 -iname 区分大小写 -delete 对符合条件的文件执行删除命令 最好先运行不带-delete的版本查看符合条件的文件。 阅读全文
posted @ 2020-11-21 17:20 2021年的顺遂平安君 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 明明没有在跑大程序,苹果的风扇还是狂转不停。看来传感器不是特别灵敏。找到一个可以手动调节的软件,可以保持中等转速。 https://crystalidea.com/macs-fan-control/download 世界瞬间清净。 阅读全文
posted @ 2020-11-21 17:19 2021年的顺遂平安君 阅读(611) 评论(0) 推荐(0) 编辑
摘要: Tidyverse selections implement a dialect of R where operators make it easy to select variables: : for selecting a range of consecutive variables. ! fo 阅读全文
posted @ 2020-11-21 17:17 2021年的顺遂平安君 阅读(162) 评论(0) 推荐(0) 编辑
摘要: namespace ‘glue’ is imported by ‘tidyselect’, ‘dplyr’ so cannot be unloaded 报错原因是dplyr和tidyselect两个包所要求的glue版本不同。把glue更新到最新版本即可,可以需要源码编译。 阅读全文
posted @ 2020-11-21 17:16 2021年的顺遂平安君 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 最忠实Leo Breiman算法的版本是 randomForest,但是这个库不支持并行,性能也比较差。 有两个优化后的替代版本,都支持并行计算。 ranger rborist 阅读全文
posted @ 2020-11-21 17:14 2021年的顺遂平安君 阅读(90) 评论(0) 推荐(0) 编辑
摘要: $R^2$不止一种定义方式,这里是scikit-learn中所使用的定义。 As such variance is dataset dependent, R² may not be meaningfully comparable across different datasets. Best pos 阅读全文
posted @ 2020-11-21 17:12 2021年的顺遂平安君 阅读(1574) 评论(0) 推荐(0) 编辑
摘要: 官方例子如下, rescale01 <- function(x) { rng <- range(x, na.rm = TRUE) (x - rng[1]) / (rng[2] - rng[1]) } df <- tibble(x = 1:4, y = rnorm(4)) df %>% mutate( 阅读全文
posted @ 2020-11-21 17:11 2021年的顺遂平安君 阅读(452) 评论(0) 推荐(0) 编辑
摘要: out-of-bag prediction Created: Jun 29, 2020 12:22 PM Updated: Jun 29, 2020 12:28 PM https://stackoverflow.com/questions/25153276/difference-of-predict 阅读全文
posted @ 2020-11-21 17:09 2021年的顺遂平安君 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 两个主要功能, 替换NA x <- c(2, 1, NA, 5, 3, NA) # Create example vector coalesce(x, 999) # Apply coalesce function # 2 1 999 5 3 999 x中的NA被替换成了999。 对比并替换 这个功能 阅读全文
posted @ 2020-11-21 17:07 2021年的顺遂平安君 阅读(243) 评论(0) 推荐(0) 编辑
摘要: case_when 要点有两个 不匹配的时候会返回 NA,而不是保持不变 根据顺序进行条件判断,顺序很重要 下面这段代码, x <- 1:50 case_when( x %% 35 == 0 ~ "fizz buzz", x %% 5 == 0 ~ "fizz", x %% 7 == 0 ~ "bu 阅读全文
posted @ 2020-11-21 17:05 2021年的顺遂平安君 阅读(4028) 评论(0) 推荐(0) 编辑
摘要: Filtering joins filter rows from x based on the presence or absence of matches in y: semi_join() return all rows from x with a match in y. anti_join() 阅读全文
posted @ 2020-11-21 17:04 2021年的顺遂平安君 阅读(401) 评论(0) 推荐(0) 编辑
摘要: bind_rows & bind_cols 这两个命令是do.call(rbind, dfs)和do.call(cbind, dfs)的代替,使用起来更有效率。 one <- starwars[1:4, ] two <- starwars[9:12, ] bind_rows(one, two) bi 阅读全文
posted @ 2020-11-21 17:02 2021年的顺遂平安君 阅读(1146) 评论(0) 推荐(0) 编辑
摘要: macOS 10.12 下使用pip install opencv-python安装OpenCV后会报错,主要是版本兼容问题。不想折腾macOS,可以安装 3.4.9.33 这个版本的OpenCV这个兼容版本。 阅读全文
posted @ 2020-11-21 16:58 2021年的顺遂平安君 阅读(234) 评论(0) 推荐(0) 编辑
摘要: summarise() regrouping output 警告 这里讨论的是return的属性,而不是group_by本身。以下面代码为例,summarise之后给出的警告信息是指,这里return的tibble的atrribute中group_by参数只有homeword,没有species。也 阅读全文
posted @ 2020-11-21 16:55 2021年的顺遂平安君 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 只能说官方的命名有点太随意,使用上二者有点细微区别。 一般compile的时候,使用的是小写的binary_crossentropy y_true = [[0., 1.], [0., 0.]] y_pred = [[0.6, 0.4], [0.4, 0.6]] # Using 'auto'/'sum 阅读全文
posted @ 2020-11-21 16:54 2021年的顺遂平安君 阅读(1691) 评论(0) 推荐(0) 编辑
摘要: 官方说明书的例子其实特别简单明了, y_true = [[0., 1.], [0., 0.]] y_pred = [[0.6, 0.4], [0.4, 0.6]] # Using 'auto'/'sum_over_batch_size' reduction type. bce = tf.keras. 阅读全文
posted @ 2020-11-21 16:52 2021年的顺遂平安君 阅读(1549) 评论(0) 推荐(0) 编辑
摘要: 最近仔细看了一下sed命令,不得不感慨sed的强大功能,感觉能写半本书了。这能总结一些最常用的。 替换并打印在屏幕上 最常用的就是替换功能。 sed 's/foo/bar/g' 这条命令都比较熟,就是把所有foo替换成bar,但是前面的s和后面的g是什么意思? 更一般的写法其实是 sed 's/re 阅读全文
posted @ 2020-11-21 05:48 2021年的顺遂平安君 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 限制CPU使用率 cpulimit -l 20 App 上面代码会将App程序的CPU使用率限制在20%,可以使用htop查看。 如果程序正在运行,可以通过其PID来限制CPU使用,比如 cpulimit -l 20 -p 1234 会限制PID为1234的进程的CPU使用率。 限制CPU核心数 以 阅读全文
posted @ 2020-11-21 05:40 2021年的顺遂平安君 阅读(509) 评论(0) 推荐(0) 编辑