Skip to content

Instantly share code, notes, and snippets.

View regonn's full-sized avatar
🍵
Tea.

regonn regonn

🍵
Tea.
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
using MultivariateStats # PCA
using PlotlyJS # データプロット用 Plotly.jl ではなく js実装を呼ぶ PlotlyJS.jl こちらの方がメンテされている
using CSV, DataFrames # CSV と DataFrames が扱えるように
df = CSV.File("SF.csv") |> DataFrame
reciprocals = 1 ./ Matrix(df[:,2:8]) # 逆数にして1番目の性格の値が大きくなるように
top5 = coalesce.(reciprocals, 0.0) # missing を zero で埋める
M = fit(PCA, top5; maxoutdim=2)
components = MultivariateStats.transform(M, top5) # 説明変数情報
projections = projection(M) # 主成分にProjection
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@regonn
regonn / Hyperopt.jl
Last active December 19, 2018 23:59
Julia 1.0 Hyperopt DecisionTree MNIST
using Hyperopt
using DecisionTree
using MLDatasets
using Statistics
train_x, train_y = MNIST.traindata(Float32)
test_x, test_y = MNIST.testdata(Float32)
train_features = Array(transpose(MNIST.convert2features(train_x)))
test_features = Array(transpose(MNIST.convert2features(test_x)))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.