Skip to content

Commit

Permalink
2024-02-09 14:46:11
Browse files Browse the repository at this point in the history
  • Loading branch information
wizardforcel committed Feb 9, 2024
1 parent 7a147c6 commit 5680888
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 105 deletions.
18 changes: 12 additions & 6 deletions docs/dl-fin/dl-fin_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ print('Number of NaN values in the CPI dataframe: ' + str(count_nan))
# Dropping the NaN values from the rows
cpi = cpi.dropna()

`# Transforming the CPI into a year-on-year measure` cpi = cpi.pct_change(periods = 12, axis = 0) * 100
# Transforming the CPI into a year-on-year measure
cpi = cpi.pct_change(periods = 12, axis = 0) * 100
cpi = cpi.dropna()

```
Expand Down Expand Up @@ -979,7 +980,8 @@ import pandas as pd
start_date = '1995-01-01'
end_date   = '2022-12-01'

`# Creating a dataframe and downloading the CPI data using its code name and its source` cpi_us = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)
# Creating a dataframe and downloading the CPI data using its code name and its source
cpi_us = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)
cpi_uk = pdr.DataReader('GBRCPIALLMINMEI', 'fred', start_date, end_date)

# Dropping the NaN values from the rows
Expand Down Expand Up @@ -1045,7 +1047,8 @@ import pandas as pd
start_date = '1950-01-01'
end_date   = '2022-12-01'

`# Creating a dataframe and downloading the CPI data using its code name and its source` cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)
# Creating a dataframe and downloading the CPI data using its code name and its source
cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)

# Dropping the NaN values from the rows
cpi = cpi.dropna()
Expand Down Expand Up @@ -1225,7 +1228,8 @@ import pandas_datareader as pdr
start_date = '1950-01-01'
end_date   = '2022-12-01'

`# Creating a dataframe and downloading the CPI data using its code name and its source` cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)
# Creating a dataframe and downloading the CPI data using its code name and its source
cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)

# Dropping the NaN values from the rows
cpi = cpi.dropna()
Expand Down Expand Up @@ -1259,7 +1263,8 @@ import pandas_datareader as pdr
start_date = '1950-01-01'
end_date   = '2022-12-01'

`# Creating a dataframe and downloading the CPI data using its code name and its source` cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)
# Creating a dataframe and downloading the CPI data using its code name and its source
cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)

# Dropping the NaN values from the rows
cpi = cpi.dropna()
Expand Down Expand Up @@ -1418,7 +1423,8 @@ import pandas_datareader as pdr
start_date = '1950-01-01'
end_date   = '2022-12-01'

`# Creating a dataframe and downloading the CPI data using its code name and its source` cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)
# Creating a dataframe and downloading the CPI data using its code name and its source
cpi = pdr.DataReader('CPIAUCSL', 'fred', start_date, end_date)

# Dropping the NaN values from the rows
cpi = cpi.dropna()
Expand Down
33 changes: 18 additions & 15 deletions docs/dl-fin/dl-fin_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ if a > b:

    print('a is greater than b')

`# Second condition (specific) `   
# Second condition (specific)    
elif a < b:

    print('a is lower than b')

`# Third condition (general)`   
# Third condition (general)   
else:

    print('a is equal to b')
Expand Down Expand Up @@ -433,7 +433,7 @@ sum_operation(1, 3) # The output of this line is 4
让我们看看如何从库中导入函数并使用它的函数:

```py
`# Importing the library`   
# Importing the library   
import math

# Using the natural logarithm function
Expand Down Expand Up @@ -491,7 +491,8 @@ def sum_operation(first_variable, second_variable):
# Create a new variable that holds the result of the function    
summed_value = sum_operation(1, 2)

`# Use the new variable in a new mathematical operation and store the result` double_summed_value = summed_value * 2
# Use the new variable in a new mathematical operation and store the result
double_summed_value = summed_value * 2

```

Expand All @@ -507,10 +508,10 @@ def square_summed_value(first_variable, second_variable):
  # Creating a variable that stores the square of final_sum
    squared_sum = final_sum ** 2

    `# The result is returned   ` 
    # The result is returned    
    return squared_sum

`# Create a new variable that holds the result of the function`  
# Create a new variable that holds the result of the function  
squared_summed_value = square_summed_value(1, 2)

```
Expand Down Expand Up @@ -644,7 +645,7 @@ IndexError: index 8 is out of bounds for axis 0 with size 8
# Defining the function
def division(first_column, second_column):

  `# Looping through the length of the created array`   
  # Looping through the length of the created array   
    for i in range(len(my_time_series)):

# First part of the exception handling
Expand All @@ -653,10 +654,10 @@ def division(first_column, second_column):
# Division operation and storing it in the variable x
            x = my_time_series[i, first_column] / my_time_series[i + 1, second_column]

  `# Outputting the result`         
  # Outputting the result         
            print(x)

  `# Exception handling of a specific error  `   
  # Exception handling of a specific error     
        except IndexError:

  # Ignoring (passing) the error
Expand Down Expand Up @@ -751,7 +752,8 @@ second_array = np.array([21, 34, 55, 89, 144, 233])
*连接*是将两个数据集通过行(axis = 0)或列(axis = 1)融合在一起的行为。让我们都做一遍:

```py
`# Reshaping the arrays so they become compatible in multidimensional manipulation` first_array = np.reshape(first_array, (-1, 1))
# Reshaping the arrays so they become compatible in multidimensional manipulation
first_array = np.reshape(first_array, (-1, 1))
second_array = np.reshape(second_array, (-1, 1))

# Concatenating both arrays by columns
Expand Down Expand Up @@ -816,7 +818,7 @@ my_array = np.array([[ 1, 2, 3, 4, 5],
my_array[0, 1] # Outputs 2

# Referring to the last value and last column of the array
my_array[-1, -1] `# Outputs 15`
my_array[-1, -1] # Outputs 15
# Referring to the third value and second to last column of the array
my_array[2, -2] # Outputs 14

Expand Down Expand Up @@ -858,10 +860,10 @@ my_df.iloc[6]['first_column'] # Outputs 7
my_df.iloc[0:3]['first_column'] # Outputs ([1, 2, 3])

# Referring to the last three values of the data frame
my_df.iloc[-3:]['first_column'] `# Outputs` ([8, 9, 10])
my_df.iloc[-3:]['first_column'] # Outputs ([8, 9, 10])

# Referring to all the values as of the second value
my_df.iloc[1:]['first_column'] `# Outputs` ([2, 3, 4, 5, 6, 7, 8, 9, 10])
my_df.iloc[1:]['first_column'] # Outputs ([2, 3, 4, 5, 6, 7, 8, 9, 10])

# Defining a multi-dimensional data frame
my_df  = pd.DataFrame({'first_column'  : [ 1611], 
Expand All @@ -877,7 +879,7 @@ my_df.iloc[0]['second_column'] # Outputs 2
my_df.iloc[-1]['fifth_column'] # Outputs 15

# Referring to the third value and second to last column of the data frame
my_df.iloc[2]['fourth_column']​ `# Outputs 14`
my_df.iloc[2]['fourth_column']​ # Outputs 14
# Referring to the first three and fourth column values of the data frame
my_df.iloc[:][['third_column', 'fourth_column']]

Expand Down Expand Up @@ -937,7 +939,8 @@ pip install MetaTrader5
```py
import datetime # Gives tools for manipulating dates and time
import pytz # Offers cross-platform time zone calculations
import MetaTrader5 as mt5 `# Importing the software's library` import pandas as pd
import MetaTrader5 as mt5 # Importing the software's library
import pandas as pd
import numpy as np 

```
Expand Down
2 changes: 1 addition & 1 deletion docs/dl-lfsci/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
+ [第一章:为什么选择生命科学?](dl-lfsci_01.md)
+ [第二章:深度学习简介](dl-lfsci_02.md)
+ [第三章:使用 DeepChem 进行机器学习](dl-lfsci_03.md)
+ [分子是复杂的实体,研究人员已经开发了许多不同的技术来对其进行特征化。这些表示包括化学描述符向量,2D 图表示,3D 静电网格表示,轨道基函数表示等等。](dl-lfsci_04.md)
+ [第四章:分子的机器学习](dl-lfsci_04.md)
+ [第五章:生物物理机器学习](dl-lfsci_05.md)
+ [第六章:基因组学的深度学习](dl-lfsci_06.md)
+ [第七章:机器学习用于显微镜](dl-lfsci_07.md)
Expand Down
10 changes: 6 additions & 4 deletions docs/dl-lfsci/dl-lfsci_04.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# 分子是复杂的实体,研究人员已经开发了许多不同的技术来对其进行特征化。这些表示包括化学描述符向量,2D 图表示,3D 静电网格表示,轨道基函数表示等等。
# 第四章:分子的机器学习

本章涵盖了在分子数据上执行机器学习的基础知识。在深入研究本章之前,我们简要讨论一下为什么分子机器学习可能是一个有益的研究课题。现代材料科学和化学的许多工作都是出于设计具有期望性质的新分子的需要。虽然已经进行了大量的科学工作来开发新的设计策略,但有时仍然需要进行大量的随机搜索来构建有趣的分子。分子机器学习的梦想是用引导搜索取代这种随机实验,机器学习预测器可以提出哪些新分子可能具有期望的性质。这样准确的预测器可以促进创造具有有用性质的全新材料和化学品。

一旦特征化,分子仍然需要进行学习。我们将回顾一些用于学习分子功能的算法,包括简单的全连接网络以及更复杂的技术,如图卷积。我们还将描述图卷积技术的一些局限性,以及我们应该期望和不应该期望的内容。我们将以一个有趣数据集上的分子机器学习案例研究结束本章。

这个梦想很吸引人,但我们如何开始这条道路呢?第一步是构建技术方法,将分子转化为数字向量,然后将其传递给学习算法。这些方法被称为*分子特征化*。我们将在本章中涵盖其中一些,并在下一章中涵盖更多。

在深入研究分子机器学习之前,回顾一下分子到底是什么将是有用的。这个问题听起来有点愚蠢,因为像 H[2]O 和 CO[2]这样的分子甚至被介绍给年幼的孩子。答案不是显而易见的。然而,事实是,对于绝大多数人类的存在,我们根本不知道分子的存在。考虑一个思想实验:你如何说服一个怀疑的外星人分子实体存在?答案是相当复杂的。例如,你可能需要使用质谱仪!
# 什么是分子?

# 本章涵盖了在分子数据上执行机器学习的基础知识。在深入研究本章之前,我们简要讨论一下为什么分子机器学习可能是一个有益的研究课题。现代材料科学和化学的许多工作都是出于设计具有期望性质的新分子的需要。虽然已经进行了大量的科学工作来开发新的设计策略,但有时仍然需要进行大量的随机搜索来构建有趣的分子。分子机器学习的梦想是用引导搜索取代这种随机实验,机器学习预测器可以提出哪些新分子可能具有期望的性质。这样准确的预测器可以促进创造具有有用性质的全新材料和化学品。什么是分子?
分子是复杂的实体,研究人员已经开发了许多不同的技术来对其进行特征化。这些表示包括化学描述符向量,2D 图表示,3D 静电网格表示,轨道基函数表示等等。

确定给定样本中存在的分子可能是非常具有挑战性的。目前最流行的技术依赖于质谱。质谱的基本思想是用电子轰击样本。这种轰击会将分子破碎成碎片。这些碎片通常会*电离*,即吸收或失去电子而带电。这些带电碎片被电场推动,根据它们的质荷比分离它们。检测到的带电碎片的分布被称为*光谱*。图 4-1 说明了这个过程。从检测到的碎片集合中,通常可以确定原始样本中存在的精确分子。然而,这个过程仍然是有损失和困难的。许多研究人员正在积极研究利用深度学习算法改进质谱技术,以便从检测到的带电光谱中更容易地识别原始分子。

# 质谱

第四章。分子的机器学习
在深入研究分子机器学习之前,回顾一下分子到底是什么将是有用的。这个问题听起来有点愚蠢,因为像 H[2]O 和 CO[2]这样的分子甚至被介绍给年幼的孩子。答案不是显而易见的。然而,事实是,对于绝大多数人类的存在,我们根本不知道分子的存在。考虑一个思想实验:你如何说服一个怀疑的外星人分子实体存在?答案是相当复杂的。例如,你可能需要使用质谱仪!

注意执行此检测的复杂性!分子是复杂的实体,很难准确地确定。

Expand Down
Loading

0 comments on commit 5680888

Please sign in to comment.