自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(7)
  • 收藏
  • 关注

原创 几种排序算法的python实现

#!/usr/bin/env python# -*- coding: utf-8 -*-import numpy as npimport randomdef bubblesort(x): """ 冒泡排序 :param x: 待排序list :return: 排序后list """ n = len(x) for ...

2019-08-26 18:59:45 152

原创 栈(添加尾部元素、删除尾部元素、返回尾部元素、返回长度、判空)

import 文件的地址https://blog.youkuaiyun.com/qq_21944445/article/details/99705171# coding:utf-8from linklist import LinkList# 栈class Stack(LinkList): def __init__(self): super().__init__() ...

2019-08-18 17:15:41 501

原创 牛顿法开根号

# coding: utf-8def get_sqrt(x, a=0.0000001): x = float(x) if x < 0: x = -x print('我猜你相求的是'+str(x)+'的根号') x0 = x while abs(x0**2 - x) > a: x0 = x0 / 2 +...

2019-08-18 15:38:27 468

原创 单向不循环链表(创建、遍历、增、删、查找、判空)

# coding: utf-8# 链表节点class Node(object): def __init__(self, item): self.item = item self.next = None# 单向不循环链表class LinkList(object): def __init__(self): self._h...

2019-08-18 15:28:27 214

原创 matrix-based CF(基于矩阵分解的协同过滤算法)

#!/usr/bin/env python# -*- coding: utf-8 -*-"""matrix_based CF"""import numpy as npimport pandas as pdclass CFmatrix(object): def __init__(self, num_feature, num_recommendation): ...

2018-12-08 15:37:25 876

原创 item-based CF(基于物品的协同过滤算法)

#!/usr/bin/env python# -*- coding: utf-8 -*-"""item_based CF"""import numpy as npimport pandas as pdclass CFItem(object): def __init__(self, k): self.top_k = k @staticmeth...

2018-12-07 21:16:15 1479

原创 pytorch实现一阶线性回归

# -*- coding: utf-8 -*- import random import torch import torch.nn as nn from torch.autograd import Variable import torch.optim as optim import numpy as np import mat...

2018-12-06 17:45:03 246

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除