This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- FILE: App.vue --> | |
| <!-- NOTE: Import bootstrap on main.js --> | |
| <template> | |
| <div id="app"> | |
| <bootsCard v-bind="{ cardT : cardTitle, alertD:alertData }"/> | |
| </div> | |
| </template> | |
| <script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Notes: | |
| # You need to install winsound: | |
| # > pip install winsound | |
| # Only works with windows, | |
| # for an alternative see following gist. | |
| import winsound | |
| # HZ and milliseconds | |
| winsound.Beep(200, 1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Notes: | |
| # Import and install numpy and simpleaudio | |
| # Volume is louder than winsound | |
| import numpy as np | |
| import simpleaudio as sa | |
| def sound(freq,sec): | |
| frequency = freq | |
| fs = 44100 #samples per second |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import winsound | |
| # HZ and milliseconds | |
| winsound.Beep(40, 1000) | |
| winsound.Beep(80, 1000) | |
| winsound.Beep(160, 1000) | |
| winsound.Beep(320, 1000) | |
| winsound.Beep(640, 1000) | |
| winsound.Beep(1280, 1000) | |
| winsound.Beep(2560, 1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import winsound | |
| # HZ and milliseconds | |
| winsound.Beep(262, 600) # C4 | |
| winsound.Beep(294, 600) # D4 | |
| winsound.Beep(330, 600) # E4 | |
| winsound.Beep(349, 600) # F4 | |
| winsound.Beep(392, 600) # G4 | |
| winsound.Beep(440, 600) # A4 | |
| winsound.Beep(494, 600) # B4 | |
| winsound.Beep(523, 600) # C3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| # CONSTANTS: | |
| ROUND = '220' | |
| TOURNAMENT_NAME = "kazutsugi" | |
| TARGET_NAME = f"target_{TOURNAMENT_NAME}" | |
| PREDICTION_NAME = f"prediction_{TOURNAMENT_NAME}" | |
| # LOAD DATASETS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tensorflow as tf | |
| from tensorflow import keras | |
| from tensorflow.keras import layers | |
| def build_model(learning_rate, layer_size): | |
| """Build Keras model""" | |
| model = keras.Sequential([ | |
| layers.Dense(layer_size, activation='relu', | |
| input_shape=[len(feature_names)]), | |
| layers.Dense(layer_size, activation='relu', kernel_regularizer='l2'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def train_model(model, feature, label, epochs, batch_size): | |
| """Train Keras Model""" | |
| history = model.fit(x=feature, | |
| y=label, | |
| batch_size=batch_size, | |
| epochs=epochs) | |
| epochs = history.epoch | |
| hist = pd.DataFrame(history.history) | |
| mse = hist["mse"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from matplotlib import pyplot as plt | |
| def plot_the_loss_curve(epochs, mse): | |
| """Plot a curve of loss vs. epoch.""" | |
| plt.figure() | |
| plt.xlabel("Epoch") | |
| plt.ylabel("Mean Squared Error") | |
| plt.plot(epochs, mse, label="Loss") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tournament_data[PREDICTION_NAME] = regressor_model.predict(tournament_data[feature_names]) | |
| df = tournament_data[PREDICTION_NAME] | |
| df.columns = ["id", "prediction_kazutsugi"] | |
| df.to_csv("Numerai/" + TOURNAMENT_NAME + "_submission_YourSubmissionName.csv", header=True) | |
| print(df) |