Skip to content

Instantly share code, notes, and snippets.

@darden1
darden1 / StudyMachineLearning_Perceptron.py
Last active August 16, 2016 11:35
StudyMachineLearning_Perceptron.py
# -*- coding: utf-8 -*-
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
def main():
# ---アヤメデータの取得
df = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header=None)
@darden1
darden1 / StudyMachineLearning_AdalineMatrixExpression.py
Last active August 16, 2016 13:36
StudyMachineLearning_AdalineMatrixExpression.py
# -*- encoding: utf-8 -*-
import numpy as np
import pandas as pd
df = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header=None)
y = df.iloc[0:4, 4].values
y = np.where(y == "Iris-setosa", -1, 1)
X = df.iloc[0:4, [0, 2]].values
#---特徴行列
@darden1
darden1 / DecisionTree.mq4
Created August 16, 2016 11:44
DecisionTree.mq4
//+------------------------------------------------------------------+
//| DecisionTree.mq4 |
//| Copyright 2016, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
//#property strict
@darden1
darden1 / PredictionBTCPriceWithDecisionTree.py
Last active December 7, 2016 11:02
PredictionBTCPriceWithDecisionTree.py
# -*- coding: utf-8 -*-
import poloniex
import time
import datetime
from sklearn import tree
def main():
# --トレーニング用パラメータ
theNumberOfTrainData=29 #トレーニングデータ数
@darden1
darden1 / BackTest.py
Last active June 20, 2017 15:18
BackTest.py
# -*- coding: utf-8 -*-
import poloniex
import time
import datetime
from sklearn import tree
import matplotlib.pyplot as plt
def main():
# --トレーニング用パラメータ
theNumberOfTrainData=29 #トレーニングデータ数
@darden1
darden1 / BackTestOptimization.py
Last active December 7, 2016 11:18
BackTestOptimization.py
# -*- coding: utf-8 -*-
import poloniex
import time
import datetime
from sklearn import tree
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pickle
@darden1
darden1 / StudyMachineLearning_Adaline.py
Last active December 22, 2018 13:45
StudyMachineLearning_Adaline.py
# -*- coding: utf-8 -*-
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
def main():
# ---アヤメデータの取得
df = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header=None)
@darden1
darden1 / StudyMachineLearning_AdalineSGD.py
Last active December 22, 2018 13:45
StudyMachineLearning_AdalineSGD.py
# -*- coding: utf-8 -*-
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
def main():
# ---アヤメデータの取得
df = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header=None)
@darden1
darden1 / StudyMachineLearning_LogisticRegression.py
Last active August 23, 2016 10:25
StudyMachineLearning_LogisticRegression.py
# -*- coding: utf-8 -*-
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
def main():
# ---アヤメデータの取得
df = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header=None)
@darden1
darden1 / ActiveSetMethod.py
Last active October 30, 2016 07:28
ActiveSetMethod.py
# -*- coding: utf-8 -*-
import numpy as np
def main():
m = 2 # 制約条件の個数
n = 2 # 設計変数の個数
x0 = np.matrix(np.zeros([n, 1])) # x初期値(適当に0ベクトルで与える)
print("-" * 80 + "\n■2つある制約条件のうちどちらも無効制約条件の場合")
Q = np.matrix([[2, 0], [0, 2]])