资源简介
爬取淘宝某个店铺的商品信息,并根据商品销量,用商品图片做矩阵树图
代码片段和文件信息
“““
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote price: quotes
that are linked tend to cofluctuate during a day.
.. _stock_market:
Learning a graph structure
--------------------------
We use sparse inverse covariance estimation to find which quotes are
correlated conditionally on the others. Specifically sparse inverse
covariance gives us a graph that is a list of connection. For each
symbol the symbols that it is connected too are those useful to explain
its fluctuations.
Clustering
----------
We use clustering to group together quotes that behave similarly. Here
amongst the :ref:‘various clustering techniques ‘ available
in the scikit-learn we use :ref:‘affinity_propagation‘ as it does
not enforce equal-size clusters and it can choose automatically the
number of clusters from the data.
Note that this gives us a different indication than the graph as the
graph reflects conditional relations between variables while the
clustering reflects marginal properties: variables clustered together can
be considered as having a similar impact at the level of the full stock
market.
embedding in 2D space
---------------------
For visualization purposes we need to lay out the different symbols on a
2D canvas. For this we use :ref:‘manifold‘ techniques to retrieve 2D
embedding.
Visualization
-------------
The output of the 3 models are combined in a 2D graph where nodes
represents the stocks and edges the:
- cluster labels are used to define the color of the nodes
- the sparse covariance model is used to display the strength of the edges
- the 2D embedding is used to position the nodes in the plan
This example has a fair amount of visualization-related code as
visualization is crucial here to display the graph. One of the challenge
is to position the labels minimizing overlap. For this we use an
heuristic based on the direction of the nearest neighbor along each
axis.
“““
from __future__ import print_function
# Author: Gael Varoquaux gael.varoquaux@normalesup.org
# License: BSD 3 clause
import sys
from datetime import datetime
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
import pandas as pd
from sklearn import cluster covariance manifold
print(__doc__)
# #############################################################################
# Retrieve the data from Internet
# The data is from 2003 - 2008. This is reasonably calm: (not too long ago so
# that we get high-tech firms and before the 2008 crash). This kind of
# historical data can be obtained for from APIs like the quandl.com and
# alphavantage.co ones.
start_date = datetime(2003 1 1).date()
end_date = datetime(2008 1 1).date()
symbol_di
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 8508 2018-11-07 10:16 plot_stock_market.py
文件 4427 2018-11-12 17:06 shop_item.py
----------- --------- ---------- ----- ----
12935 2
相关资源
- 微信小程序仿淘宝图片轮播+视频播放
- 淘宝服务器时间获取更改本地时间
- 2017淘宝天猫采集V17.7.zip
- 模拟Digest认证的登录demo
- 天猫装修全屏轮播图代码_淘宝首页海
- 一个图片爬虫和音乐爬虫
- 爬虫项目完整代码
- 淘宝秒杀源代码
- 网络爬虫,多功能,有界面显示,代
- 淘宝宝贝评价、商品属性提取采集器
- 淘宝网的所有类目汇总
- 类似淘宝内页回到顶部代码
- jsoup从网络上抓取图片
- R语言微博爬虫RWEIBO
- 淘宝网源码
- 淘宝评论采集器免费版
- 淘宝用例图
- 淘宝标题工具
- 廖雪峰商业爬虫
- qq消息淘宝转链免费版1.0.0推荐商品加
- 淘宝天猫拼多多图片器源码
- 根据关键词使用scrapy爬取今日头条网
- 最新老虎淘客系统+老虎app+微信淘宝客
- xpath_helper.crx(chrome爬虫网页解析工具
- 基于Web的网络爬虫的设计与实现.pdf
- 淘宝去除导航栏所有分类代码
- 百姓网二手房源出售信息采集爬虫源
- 小飞淘口令解析.exe
- 淘宝评论采集器
- 12306爬虫源码
评论
共有 条评论