快乐冲浪与生活

多体验、多体会、多体悟

0%

LOF 是无监督基于密度的异常检测算法,核心思想:异常点的局部密度显著低于周边邻居,通过量化「局部密度差异」给出每个样本的异常分数。

LOF 的适用场景:

  1. 数据集存在多个疏密不同的聚类
  2. 不需要异常标签,纯无监督筛查离群点

核心公式

当前距离公式采用欧式距离。

本文在 LLM 对话中学习、总结、记录

响应式 API

响应式 API 是 Vue 官方提供的一组函数,专门用来把普通变量 / 对象变成自动监听变化、自动更新视图的接口。Vue3 响应式 API共分成 4 类:

FAIR 是一套科研数据与资源可发现、可访问、可互操作、可复用的国际通用准则。

F = FindableA = AccessibleI = Interoperable R = Reusable

F

数据、流程、工具、样本资源容易被检索、定位

局部变量优化,是指将全局变量 / 函数的地址赋值给局部变量,从而减少内存寻址的开销。

我自己的一个观点,大多数应用的瓶颈在于数据库、磁盘 I/O,所以一般不会用这一优化技术。但我今天在项目代码中看到类似的代码, 又问了豆包,豆包说有场景有必要,所以写一个测试验证一下。

本文用于记录在使用 Python 过程中不知道的类装饰器的用法与功能。

@dataclass

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
"""Add dunder methods based on the fields defined in the class.

Examines PEP 526 __annotations__ to determine fields.

If init is true, an __init__() method is added to the class. If repr
is true, a __repr__() method is added. If order is true, rich
comparison dunder methods are added. If unsafe_hash is true, a
__hash__() method is added. If frozen is true, fields may not be
assigned to after instance creation. If match_args is true, the
__match_args__ tuple is added. If kw_only is true, then by default
all fields are keyword-only. If slots is true, a new class with a
__slots__ attribute is returned.
"""

根据类中字段的定义,给类添加魔法方法:

在数据库中,查询按某一字段降序和升序的关键字,分别是 DESCASC,不指定则默认按升序,也就是 ASC,如下面三个查询:

不指定

1
SELECT created_at, id FROM llm_models ORDER BY created_at;

指定 ASC

1
SELECT created_at, id FROM llm_models ORDER BY created_at ASC;

最近在写一个产品,在认证鉴权模块用到了 JWT,为探究其本质,所以打算花一些时间学习一下,并记录成文。

首先,回答两个问答:

  1. 什么是 JWT?
  2. JWT 解决了什么样的问题?

什么是 JWT?