scipy

自己动手写一个印钞机 第三章

那年仲夏 提交于 2021-02-13 16:39:51
作者:阿布🐶 未经本人允许禁止转载 ipython notebook git版本 目录章节地址: 自己动手写一个印钞机 第一章 自己动手写一个印钞机 第二章 自己动手写一个印钞机 第三章 自己动手写一个印钞机 第四章 自己动手写一个印钞机 第五章 自己动手写一个印钞机 第六章 自己动手写一个印钞机 第七章 简书目录章节地址: 自己动手写一个印钞机 第一章 自己动手写一个印钞机 第二章 自己动手写一个印钞机 第三章 自己动手写一个印钞机 第四章 自己动手写一个印钞机 第五章 自己动手写一个印钞机 第六章 自己动手写一个印钞机 第七章 自己动手写一个印钞机 附录章 股票量化专题地址,请关注,谢谢! 非均衡胜负收益带来的必然非均衡胜负比例,目标由因子的能力解决一部分,模式识别提升关键的一部分 上一章使用机器学习的方法,想要提取特征,指导交易,提高胜率,但是发现,除了最后那种把交易结果分成100份的方式外,其它机器学习方法基本都是瞎猜,是不是使用深度学习就能解决问题呢?本章主要通过使用卷积神经网络模型alex_net, 与google_lenet对stock进行模式识别 加载缓存交易数据 # 从之前跑的结果hdf5中加载缓存 from MlFiterDegPd import MlFiterDegPdClass orders_pd_train_snap = ZCommonUtil.load

Python中数据的保存和读取

喜欢而已 提交于 2021-02-12 19:06:02
参考文献: https://www.cnblogs.com/Yiutto/p/5827775.html 在科学计算的过程中,往往需要保存一些数据,也经常需要把保存的这些数据加载到程序中,在 Matlab 中我们可以用 save 和 lood 函数很方便的实现。类似的在 Python 中,我们可以用 numpy.save() 和 numpy.load() 函数达到类似的效果,并且还可以用 scipy.io.savemat() 将数据保存为 .mat 格式,用scipy.io.loadmat() 读取 .mat 格式的数据,达到可以和 Matlab 或者Octave 进行数据互动的效果. 下面分别介绍之: numpy.save() 和 numpy.load() numpy.save(arg_1,arg_2) 需要两个参数,arg_1 是文件名,arg_2 是要保存的数组. 如: import numpy as np a=np.mat('1,2,3;4,5,6') b=np.array([[1,2,3],[4,5,6]]) np.save('a.npy',a) np.save('b.npy',b) 这个时候 Python 的当前工作路径下就会多出 a.npy 和 b.npy 两个文件,当然我们也可以给出具体的路径,如 np.save('D:/PythonWork/a.npy',a)

Compute a confidence interval from sample data assuming unknown distribution

让人想犯罪 __ 提交于 2021-02-12 11:32:07
问题 I have sample data which I would like to compute a confidence interval for, assuming a distribution is not normal and is unknown. Basically, it looks like distribution is Pareto but I don't know for sure. The answers for the normal distribution: Compute a confidence interval from sample data Correct way to obtain confidence interval with scipy 回答1: If you don't know the underlying distribution, then my first thought would be to use bootstrapping: https://en.wikipedia.org/wiki/Bootstrapping_

Compute a confidence interval from sample data assuming unknown distribution

女生的网名这么多〃 提交于 2021-02-12 11:31:10
问题 I have sample data which I would like to compute a confidence interval for, assuming a distribution is not normal and is unknown. Basically, it looks like distribution is Pareto but I don't know for sure. The answers for the normal distribution: Compute a confidence interval from sample data Correct way to obtain confidence interval with scipy 回答1: If you don't know the underlying distribution, then my first thought would be to use bootstrapping: https://en.wikipedia.org/wiki/Bootstrapping_

Python之数据分析工具包介绍以及安装【入门必学】

≯℡__Kan透↙ 提交于 2021-02-12 04:32:08
前言 本文的文字及图片来源于网络,仅供学习、交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理。 首先我们来看 Mac版 按照需求大家依次安装,如果你还没学到数据分析,建议你先学好Pytho基础和爬虫再来。可以去小编的Python交流.裙 :一久武其而而流一思(数字的谐音)转换下可以找到了,里面有最新Python教程项目 python3 -m pip install numpy python3 -m pip install --upgrade pip //依次安装 python3 -m pip install pandas python3 -m pip install wordcloud python3 -m pip install matplotlib python3 -m pip install scipy python3 -m pip install -U scikit-learn Matplotlib Matplotlib是Python的一个可视化模块,他能方便的只做线条图、饼图、柱状图以及其他专业图形。 如果看不懂,说明你基础还没学好后。可以去小编的Python交流.裙 :一久武其而而流一思(数字的谐音)转换下可以找到了,里面有最新Python教程项目,学好在看这篇 使用Matplotlib,可以定制所做图表的任一方面

Fitting multiple Lorentzians to Brillouin Spectrum using Scipy in Python 3

醉酒当歌 提交于 2021-02-11 17:00:52
问题 I am trying to fit Brillouin Spectra (with several peaks) using scipy.optimize.curve_fit. I have have multiple spectra with several peaks and I am trying to fit them with lorentzian functions (one Lorentzian per peak). I am trying to automate the process for bulk analysis (i.e., using the peak finding algorithm of scipy to get peak positions, peak widths and peaks heights and use them as initial guesses for the fit). I am now working on one spectrum to see if the general idea works, then I

Scipy solve_ivp vs odeint

ⅰ亾dé卋堺 提交于 2021-02-11 16:59:51
问题 I have a large system of differential equations I am trying to solve. I get the same results using scipy.odeint and scipy.solve_ivp , however the former is ~17 times faster in my case. I read that solve_ivp is recommended for initial value problems, but can't find more on why I can't use odeint (when it's giving me the same results). Do I need to use solve_ivp when I am getting the same results as from odeint ? When would I use one vs the other? Thanks. 来源: https://stackoverflow.com/questions

Scipy solve_ivp vs odeint

隐身守侯 提交于 2021-02-11 16:58:48
问题 I have a large system of differential equations I am trying to solve. I get the same results using scipy.odeint and scipy.solve_ivp , however the former is ~17 times faster in my case. I read that solve_ivp is recommended for initial value problems, but can't find more on why I can't use odeint (when it's giving me the same results). Do I need to use solve_ivp when I am getting the same results as from odeint ? When would I use one vs the other? Thanks. 来源: https://stackoverflow.com/questions

Fitting multiple Lorentzians to Brillouin Spectrum using Scipy in Python 3

杀马特。学长 韩版系。学妹 提交于 2021-02-11 16:58:45
问题 I am trying to fit Brillouin Spectra (with several peaks) using scipy.optimize.curve_fit. I have have multiple spectra with several peaks and I am trying to fit them with lorentzian functions (one Lorentzian per peak). I am trying to automate the process for bulk analysis (i.e., using the peak finding algorithm of scipy to get peak positions, peak widths and peaks heights and use them as initial guesses for the fit). I am now working on one spectrum to see if the general idea works, then I

Simultaneous optimization of two different functions to provide a universal solution for both

爷,独闯天下 提交于 2021-02-11 15:38:45
问题 I asked a similar question in January that @Miłosz Wieczór was kind enough to answer. Now, I am faced with a similar but different challenge since I need to fit two parameters ( fc and alpha ) simultaneously on two datasets ( e_exp and iq_exp ). I basically need to find the values of fc and alpha that are the best fits to both data e_exp and iq_exp . import numpy as np import math from scipy.optimize import curve_fit, least_squares, minimize f_exp = np.array([1, 1.6, 2.7, 4.4, 7.3, 12, 20, 32