Skip to content

Instantly share code, notes, and snippets.

View jason-xuan's full-sized avatar

xuan jason-xuan

View GitHub Profile
import numpy as onp
import mindspore.scipy as msp
import mindspore.numpy as mnp
from mindspore import context, nn, ms_function
from mindspore.ops import functional as F
from mindspore.common import Tensor
# from mindspore.scipy.sparse.linalg import IterativeGmres
from mindspore.scipy.utils import _to_tensor
onp.random.seed(0)
@jason-xuan
jason-xuan / degenerate.jl
Created April 11, 2019 15:51
test code for degenerate
using Test, Distributions, CSV, GLM, Lasso, DataFrames
using Random, Distributed, LinearAlgebra, SparseArrays, SharedArrays
include("./test/testutils.jl")
include("./test/addworkers.jl")
import HurdleDMR; @everywhere using HurdleDMR
include("./test/testdata.jl")
@jason-xuan
jason-xuan / hurdle.jl
Created April 8, 2019 06:11
some test script for the standardize method
using Test, Distributions, CSV, GLM, Lasso, DataFrames
using Random, Distributed, LinearAlgebra, SparseArrays, SharedArrays
include("./test/testutils.jl")
include("./test/addworkers.jl")
import HurdleDMR; @everywhere using HurdleDMR
include("./test/testdata.jl")
@jason-xuan
jason-xuan / lda_small.ipynb
Created August 9, 2017 13:27
lda in small dataset
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jason-xuan
jason-xuan / tfidf.ipynb
Last active August 7, 2017 11:58
apply news data to classfication problem with tfidf method for feature extraction
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jason-xuan
jason-xuan / souhu.py
Last active August 7, 2017 03:30
爬搜狐
# -*- coding: utf-8 -*-
# @Author: jason-xuan
# @Date: 2017-08-07 09:33:12
# @Last Modified by: jason-xuan
# @Last Modified time: 2017-08-07 11:25:45
import os
import requests
from bs4 import BeautifulSoup
from tqdm import tqdm
@jason-xuan
jason-xuan / tfidf.py
Last active August 6, 2017 12:23
tfidf implementation
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 19 00:07:09 2017
@author: zjxua
"""
import math
import numpy as np
from functools import reduce
from pprint import pprint
@jason-xuan
jason-xuan / words.txt
Last active February 3, 2023 14:02
曲根万词
知识点1: 前言部分词汇 regress –manly
regress(progress:进度)
ingress 进入
improvise 即兴创作
benefactor(manufacturer:制造商)
shelter 避难所,保护
shield(shell:壳)
fetter 束缚
disburse(apart:除)
@jason-xuan
jason-xuan / scrapy.py
Created July 24, 2017 10:24
爬网易新闻的xpath
title = ''.join(response.xpath("//div[@class='post_content_main']/h1/text()").extract())
text = '\n'.join(response.xpath("//div[@class='post_text']/p/text()").extract())
@jason-xuan
jason-xuan / novel_download.py
Last active July 21, 2017 02:47
下载某小说网站的小说的简单代码(单线程)
import requests
from re import compile
from tqdm import tqdm
from bs4 import BeautifulSoup
root_url = 'http://www.biquzi.com'
def get_urls_from_main_page(url) -> list: