2017-02-22 南非德本站 Durban, South Africa Station 空氣2號 Air 2 (Arduino Uno + LF298N) - Analysis |
2017-02-22 南非德本站 Durban, South Africa Station 空氣2號 Air 2 (Arduino Uno + LF298N) |
# coding: utf-8
# Quake Forecast: Predict Time, Location and Magnitude of a Quake
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestClassifier
left_half_duration = 3
right_half_duration = 1
right_half_estimate = 2
predict_duration = left_half_duration + right_half_duration + right_half_estimate
predict_height = 8
train = pd.read_csv('quake_signals.csv')
print(train)
features = ['Duration', 'Height']
data = train[features]
print(data)
# Predict Time
target = train['Time']
print(target)
model = LinearRegression()
model.fit(data, target)
quake_time = model.predict([[predict_duration, predict_height]])
print(quake_time)
print('Time: ' , round(right_half_estimate + quake_time[0]), ' days')
# Predict Location
target = train['Location']
print(target)
model = RandomForestClassifier()
model.fit(data, target)
quake_location = model.predict([[predict_duration, predict_height]])
print(quake_location)
# Predict Magnitude
target = train['Magnitude']
print(target)
model = LinearRegression()
model.fit(data, target)
quake_magnitude = model.predict([[predict_duration, predict_height]])
print(quake_magnitude)
程式碼放在:https://github.com/dysonlin1/Quake-Forecast
這次的預測,發布為:(AI預測菲律賓;我預測日本) 南非德本站修正地震預報:橙:5日以內,菲律賓或日本,M7.3 南アフリカ ダーバン局補正地震予報:オレンジ:5日以内に、フィリピンまたは日本、M7.3 Durban, South Africa Station Revised Quake Forecast: Orange: within 5 days, Philippines or Japan, M7.3
台灣地震預測研究所 所長
林湧森
2017-02-22 17:01 UTC+8
沒有留言:
張貼留言