1. ホーム
  2. Python

python 1e-5とはどういう意味ですか?

2022-02-21 04:06:16
<パス

x = 1e-4
印刷 x
は0.0001を出力します
もし、e-5が欲しいなら、次のように書く必要があります。
1e-5
1e-05が出力される、彼が変更しなかったわけではないが、それは自動的に0.00001から1e-05に変換される
x = 0.00001を試すことができます
印刷 x
1つのことを出力する 1e-05


#encoding=utf8
import os
import pandas as pd
if os.path.exists('. /step2/result.csv'):
    os.remove('. /step2/result.csv')
    
#********* Begin *********#
# Get the training data
train_data = pd.read_csv('. /step2/train_data.csv')
# Get training labels
train_label = pd.read_csv('. /step2/train_label.csv')
train_label = train_label['target']
# Get the test data
test_data = pd.read_csv('. /step2/test_data.csv')

from sklearn.neural_network import MLPClassifier
mlp = MLPClassifier(solver='lbfgs',max_iter =10,
           alpha=1e-5,hidden_layer_sizes=(10,5))
mlp.fit(train_data, train_label)
results = mlp.predict(test_data)

df = pd.DataFrame(results,columns =['result'])
df.to_csv(". /step2/result.csv", encoding="utf-8-sig", mode="a", header=True, index=False)
# ********* End *********#

#encoding=utf8
import os
import pandas as pd
if os.path.exists('. /step2/result.csv'):
    os.remove('. /step2/result.csv')
    
#********* Begin *********#
# Get the training data
train_data = pd.read_csv('. /step2/train_data.csv')
# Get the training label
train_label = pd.read_csv('. /step2/train_label.csv')
train_label = train_label['target']
# Get the test data
test_data = pd.read_csv('. /step2/test_data.csv')

from sklearn.neural_network import MLPClassifier
mlp = MLPClassifier(solver='lbfgs',max_iter =10,
           alpha=0.00001,hidden_layer_sizes=(10,5))
mlp.fit(train_data, train_label)
results = mlp.predict(test_data)

df = pd.DataFrame(results,columns =['result'])
df.to_csv(". /step2/result.csv", encoding="utf-8-sig", mode="a", header=True, index=False)
# ********* End *********#



#encoding=utf8
import os
import pandas as pd
if os.path.exists('. /step2/result.csv'):
    os.remove('. /step2/result.csv')
    
#********* Begin *********#
# Get the training data
train_data = pd.read_csv('. /step2/train_data.csv')
# Get the training label
train_label = pd.read_csv('. /step2/train_label.csv')
train_label = train_label['target']
# Get the test data
test_data = pd.read_csv('. /step2/test_data.csv')

from sklearn.neural_network import MLPClassifier
mlp = MLPClassifier(solver='lbfgs',max_iter =10,
           alpha=0.00001,hidden_layer_sizes=(10,5))
mlp.fit(train_data, train_label)
results = mlp.predict(test_data)

df = pd.DataFrame(results,columns =['result'])
df.to_csv(". /step2/result.csv", encoding="utf-8-sig", mode="a", header=True, index=False)
# ********* End *********#


上と下の結果は同じです