函数使用
来源:互联网 发布:windows 10 恢复备份 编辑:程序博客网 时间:2024/06/05 17:25
numpy
numpy.vstack
Stack arrays in sequence vertically (row wise).
按行添加数据
>>> a = np.array([1, 2, 3])>>> b = np.array([2, 3, 4])>>> np.vstack((a,b))array([[1, 2, 3], [2, 3, 4]])>>> a = np.array([[1], [2], [3]])>>> b = np.array([[2], [3], [4]])>>> np.vstack((a,b))array([[1], [2], [3], [2], [3], [4]])
numpy.ravel
多维数据变成一维数据
Returns:
y : array_like
If a is a matrix, y is a 1-D ndarray, otherwise y is an array of the same subtype as a. The shape of the returned array is (a.size,). Matrices are special cased for backward compatibility.
matplotlib
pandas
describe
将数据集的一些特性打印出来,默认打印的是数字类型的,如果想要打印categorical 类型,可以
df.describe(include=[‘O’]),这里是大写的字母O。include, exclude : list-like, ‘all’, or None (default)
Specify the form of the returned result. Either:
None to both (default). The result will include only numeric-typed columns or, if none are, only categorical columns.
A list of dtypes or strings to be included/excluded. To select all numeric types use numpy numpy.number. To select categorical objects use type object. See also the select_dtypes documentation. eg. df.describe(include=[‘O’])
If include is the string ‘all’, the output column-set will match the input one.
sklearn
sklearn.datasets.make_classificationn_
samples : int, optional (default=100)
The number of samples.n_features : int, optional (default=20)
The total number of features. These comprise n_informative informative features, n_redundant redundant features, n_repeated duplicated features and n_features-n_informative-n_redundant- n_repeated useless features drawn at random.n_informative : int, optional (default=2)
The number of informative features. Each class is composed of a number of gaussian clusters each located around the vertices of a hypercube in a subspace of dimension n_informative. For each cluster, informative features are drawn independently from N(0, 1) and then randomly linearly combined within each cluster in order to add covariance. The clusters are then placed on the vertices of the hypercube.n_classes : int, optional (default=2)
The number of classes (or labels) of the classification problem.weights : list of floats or None (default=None)
The proportions of samples assigned to each class. If None, then classes are balanced. Note that if len(weights) == n_classes - 1, then the last class weight is automatically inferred. More than n_samples samples may be returned if the sum of weights exceeds 1.
sklearn.metrics.confusion_matrix
y_true : array, shape = [n_samples]
Ground truth (correct) target values.y_pred : array, shape = [n_samples]
Estimated targets as returned by a classifier.labels : array, shape = [n_classes], optional
List of labels to index the matrix. This may be used to reorder or select a subset of labels. If none is given, those that appear at least once in y_true or y_pred are used in sorted order.sample_weight : array-like of shape = [n_samples], optional
Sample weights.return
C : array, shape = [n_classes, n_classes]
Confusion matrix
- 使用函数
- 函数使用
- 使用函数
- 函数与函数使用
- 跨函数使用malloc函数
- 函数:使用函数指针操作函数
- lua 函数 使用 lua 函数 高级使用
- struts 标签使用 使用函数
- memset函数 memcpy函数 memcmp函数------ 函数使用笔记
- Win32函数使用笔记
- 使用通用函数
- 简单使用_dopostback函数
- 使用excel的函数
- 第一次使用函数指针
- 仿函数使用要领
- format函数的使用
- format函数的使用
- SetTimer函数的使用
- 小白笔记--------------------leetcode27. Remove Element
- Nginx反向代理和负载均衡的一点想法以及常见错误
- 浙江中医药大学暑期训练测试赛八I
- spark和storm的对比
- android 前后台切换 回调
- 函数使用
- hadoop中namenode不能启动,导致浏览器不能连接
- JAVA——比较运算符
- Nginx反向代理设置从80端口转向其他端口
- 使用Myeclipse搭建的第一个SSH例子
- Python中打印如何不换行?
- HTML2 body中的属性、列表、表格、表单、Div和Span、框架标签
- PHP迭代器的小坑
- IDEA Debug模式下启动慢的解决办法