Skip to content

Commit

Permalink
migrating
Browse files Browse the repository at this point in the history
  • Loading branch information
markdregan committed Feb 4, 2023
1 parent 664f7bd commit c4aed2c
Show file tree
Hide file tree
Showing 24 changed files with 9,521 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Freqtrade rules
config*.json
*.sqlite
*.sqlite-shm
*.sqlite-wal
Expand All @@ -9,8 +8,9 @@ user_data/*
!user_data/notebooks
!user_data/models
!user_data/freqaimodels
!user_data/dashboards
!user_data/strategies
user_data/models/*
user_data/notebooks/*
freqtrade-plot.html
freqtrade-profit-plot.html
freqtrade/rpc/api_server/ui/*
Expand Down
30 changes: 30 additions & 0 deletions user_data/dashboards/FeatureImportanceDash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import streamlit as st
import sqlite3
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

# Connect to the SQLite database
conn = sqlite3.connect("litmus.sqlite")
# Query the data
data = pd.read_sql_query("SELECT * FROM feature_importance_history", conn)
# Disconnect from the database
conn.close()


# Print
st.dataframe(data)

# Boxplot
data = data[data["pair"] == "SOL/USDT:USDT"]
ranks = data.groupby("feature_id")["importance"].mean().sort_values()[::-1].index

sns.set_theme(style="ticks")

fig, ax = plt.subplots(figsize=(7, 200))
sns.boxplot(x="importance", y="feature_id", data=data,
whis=[0, 100], width=.6, palette="vlag", order=ranks)
ax.xaxis.grid(True)
ax.set(ylabel="")
sns.despine(trim=True, left=True)
st.pyplot(fig)
36 changes: 36 additions & 0 deletions user_data/dashboards/demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import streamlit as st
import numpy as np
import pandas as pd

st.write("# Litmus Dashboard")
st.write("Here's our first attempt at using data to create a table:")
st.write(pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
}))

st.write("### Line chart")
chart_data = pd.DataFrame(
np.random.randn(20, 3),
columns=['a', 'b', 'c'])
st.line_chart(chart_data)

st.write("### Map demo")
map_data = pd.DataFrame(
np.random.randn(1000, 2) / [50, 50] + [37.76, -122.4],
columns=['lat', 'lon'])
st.map(map_data)

st.write("### Slider")
x = st.slider('x') # 👈 this is a widget
st.write(x, 'squared is', x * x)

st.text_input("Your name", key="name")
st.session_state.name

if st.checkbox('Show dataframe'):
chart_data = pd.DataFrame(
np.random.randn(20, 3),
columns=['a', 'b', 'c'])

chart_data
Loading

0 comments on commit c4aed2c

Please sign in to comment.