ForHeart
ForHeart
全部文章
分类
归档
标签
去牛客网
登录
/
注册
ForHeart的博客
TA的专栏
153篇文章
31人订阅
进阶高级测试工程师
142篇文章
1443人学习
AI自动测试化入门到精通
11篇文章
912人学习
全部文章
(共156篇)
题解 | 特征扩展实现
import numpy as np def feature_scaling(data): # 补全代码 # 标准化 (Z-score 标准化) mean = np.mean(data, axis=0) std = np.std(data, axis=0) ...
2025-03-04
0
74
题解 | 使用梯度下降的线性回归
import numpy as np def linear_regression_gradient_descent(X, y, alpha, iterations): # 补全代码 m, n = X.shape theta = np.zeros((n,1)) # 包括截距项...
2025-03-04
0
82
题解 | 实现压缩行稀疏矩阵(CSR)格式转换
import numpy as np import scipy.sparse def compressed_row_sparse_matrix(dense_matrix): csr_matrix = scipy.sparse.csr_matrix(dense_matrix) vals...
2025-03-03
0
65
题解 | 将向量转换为对角矩阵
import numpy as np def make_diagonal(x): arr = np.array( x , dtype=np.float32 ) return np.diag(arr) if __name__ == "__main__&q...
2025-03-03
0
72
题解 | 基向量变换矩阵
import numpy as np def transform_basis(B, C): res = np.linalg.solve(C,B).tolist() return res if __name__ == "__main__": B = ...
2025-03-03
0
61
题解 | 基向量变换矩阵
import numpy as np def transform_basis(B, C): res = np.linalg.solve(C,B).tolist() return res if __name__ == "__main__": B = ...
2025-03-03
0
78
题解 | 基向量变换矩阵
import numpy as np def transform_basis(B, C): B1 = np.linalg.inv(B) res = np.linalg.solve(C,B).tolist() return res if __name__ == &quo...
2025-03-03
0
79
题解 | 点积计算器
import numpy as np def calculate_dot_product(vec1, vec2): """ Calculate the dot product of two vectors. Args: vec1...
2025-03-03
0
77
题解 | 泊松分布概率计算器
import math from scipy.stats import poisson def poisson_probability(k, lam): """ Calculate the probability of observing exactly k ev...
2025-03-03
0
93
题解 | 数组中只出现一次的两个数字
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param nums int整型一维数组 # @return int整型一维数组 # class Solution: def FindNumsAppearOnce(self , nums: L...
2025-03-03
0
57
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页