Accuracy and Loss in MLP

I am trying to explore models for predicting whether a team will win or lose based on features about the team and their opponent. My training data is 15k samples with 760 numerical features. Each sample represents a game between two teams and the features are long and short term statistics about each team at the time of the game (i.e. avg points over last 10 games). My thought was to use a binary classifier as a multi layered perceptron. …
Category: Data Science

How to make a custom search template for custom taxonomy?

I have created the custom post type "truck" with custom post type ui plugin. I then created a couple of custom taxonomies "make" and "model". I am using Advanced Custom Fields in the templates to display the output the way I want it. I have everything looking and working the way I want it to.. almost. I am using the plugin search & filter to allow for filtering by custom taxonomy. So where I am getting hung up is when …
Category: Web

Add wp_add_inline_style into another wp_add_inline_style for better performance

function loadOneStylePage(){ wp_enqueue_style( 'main-style', get_template_directory_uri() . '/styles/main.css', array(), _S_VERSION ); wp_enqueue_style( 'main-style-separate-file', get_template_directory_uri() . '/styles/main.css', array(), _S_VERSION ); //i would like to merge the two files? wp_add_inline_style( 'main-style-separate-file', 'main-style' ); } add_action('wp-enquueue_scripts', 'loadOneStylePage'); Ideally, I would like to put these two together as 1 file. I know i can merely edit the single file and plainly add all the css together but for the sake of creating a custom theme and providing additional options is never bad. I know the …
Category: Web

Predicting a signal based on other signals

I want to predict a signal based on other related signals, how would I go about doing this? My current approach is to do some feature extraction (in the time and frequency domain) on both the ground truth signal and on the input signals. I use the features that I calculated on my input signals to predict the ground truth signal with basic regression models such as RandomForestRegressor or GradientBoostingRegressor models. I've used a rolling window approach with varying step/window …
Category: Data Science

Repeatable field within repeatable group of fields

Compounding on Saving metabox repeatable fields ... I've created a metabox with a series of fields that are repeatable. However, within those fields, I'd like to create another field named Choices and make that repeatable within each grouping. I was able to setup the additional field and repeat it, but have no idea how to save the value of the new repeatable field. The new field that I was trying to create is within the commented portions of the code …
Category: Web

Ajax callback not work

My files is : synergyservice.php register_activation_hook( __FILE__, array( 'Synergy', 'plugin_activation' ) ); register_deactivation_hook( __FILE__, array( 'Synergy', 'plugin_deactivation' ) ); if ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { require_once( __DIR__ . '/environments.php' ); require_once( SYNERGY__PLUGIN_DIR . 'class.synergyservices.php' ); require_once( wp_normalize_path (SYNERGY__PLUGIN_DIR . 'admin/Helpers/class.helper.php' ) ); add_action( 'init', array( 'Synergy', 'init' ) ); require_once( wp_normalize_path(SYNERGY__PLUGIN_DIR . 'admin/Classes/class.synergy-admin.php') ); add_action( 'init', array( 'Synergy_admin', 'init' ) ); } class-synergyservice.php <?php class Synergy{ private static bool $initiated = false; public …
Category: Web

Getting vague results using VAR time series forecasting in python!

Firstly, I am a beginner in this field of Data Science and have tried to implement some time series models for wind speed forecasting. Also, I am aware of the fact that some regression models might give better results, but still, my aim is to crack the same with the help of VAR I tried to implement multivariate time series forecasting - VAR in python. To start with I followed the code in this article- https://towardsdatascience.com/simple-multivariate-time-series-forecasting-7fa0e05579b2 However, the forecasted value …
Category: Data Science

How to use Keras Linear Regression for Multiple input-output?

I was trying to use this code. I put part of the parameter list, but as you see the error indicates that it's taking the first member of each list to put in the first row and second ones for the second row and so on .. from pylab import * from keras.models import Sequential from keras.layers import Dense from keras import optimizers #Generate dummy data data = [[45,45,200,300],[44.7,45.6,50,60],[9.9,10,11,12]] y = data*5 #Define the model def baseline_model(): model = Sequential() …
Category: Data Science

Remove all link title attributes

After reading this and this, I want to remove the title attribute from all links of my blog, as that is good from accessibility point of view. How this can be achieved? UPDATE I found a solution how to remove title attribute from images, but it doesn't work for me.
Category: Web

Store preprocessing function along with model in mlflow.keras

The following is a simplified code snipet that is relevant to storing keras LSTM models in MLFlow. with mlflow.start_run() as run: mlflow.keras.log_model(model,"lstm") mlflow.log_params(model_parameters) mlflow.log_metrics(model_metrics) However, suppose that for each model there is a corresponding data preprocessing function that need be applied to new data before prediction. processed_data = custom_processing_function(new_data) predictions = model.predict(processed_data) Because each model may have a different preprocessing function, I want to keep track of each pair of the form (preprocessing function, model). Ideally, I am looking for …
Category: Data Science

date_query empty results with custom post type

I am trying to use get_posts to return data between certain dates but I always get an empty result even though there is a lot of data. This is for a custom post type. $args = array( 'post_type' => 'bookings', 'fields' => 'ids', 'post_status' => 'any', 'posts_per_page' => -1, 'date_query' => array( array( 'after' => '2022-01-01', 'before' => '2022-06-01', 'inclusive' => true, ), ) ); $data = get_posts($args); die(var_dump($data)); I also tried something like the below to get a specific …
Category: Web

Search WP API using the post title

I'm using the WP REST API v2 to try and search for all posts with the same title, what I'm trying to do is create a sort of head-to-head/previous meetings page for 2 teams. At the moment i can retrieve a single post with a slug no problem .../wp-json/sportspress/v2/events?slug=team1-vs-team2 When i use a search it retrieves all the events with team1 and team2, but also all references to team1 & 2 from post content which is not what I want... …
Category: Web

Cat2Vec implementation X = categorical and y = categorical

I am trying to convert categorical values (zipcodes) with Cat2Vec into a matrix which can be used as an input shape for categorical prediction of a target with binary values. After reading several articles, among which: https://www.yanxishe.com/TextTranslation/1656?from=csdn I am having trouble to understand two things: 1) With respect to which y in Cat2Vec encoding are you creating embeddings. Is it with respect to the actual target in the dataset you are trying to predict, or can you randomly choose any …
Category: Data Science

Cannot get wpdb data (Error in a simple fuction)

I'm using Cryto Plugin and want to get coin price data from plugin db. For easy practice, I'm trying to get BTC data. <?php function get_coin_price($coin_symbol) { global $wpdb; $coin_price = $wpdb->get_var($wpdb->prepare("SELECT price FROM {$wpdb->prefix}cmc_coins_v2 WHERE symbol = '%s'", $coin_symbol)); return $coin_price; }?> And if I want to get BTC price, I use this code. <?php get_coin_price(BTC); ?> However I'm getting this error "Use of undefined constant BTC - assumed 'BTC' (this will throw an Error in a future version …
Category: Web

Generalize min-max scaling to vectors

I am combining several vectors, where each vector is a certain kind of embedding of some object. Since each embedding is very different (some have all components between $[0, 1]$ some have components in the range of around 60 or 70 etc.) I want to rescale the vectors before combining them. I thought about using something like min-max rescaling, but I'm not sure how to generalize it to vectors. I could do something of the sort - $\frac{v-|v_{min}|}{|v_{max}|-|v_{min}|)}$ but I …
Category: Data Science

get all posts in custom post type by ACF field value

I have a custom post type with custom fields(advanced custom fields plugin). one of the custom fields named program_id. i can`t understand how to get all of the posts in that CPT where the ACF field value is x, and only them. i read ACF guide but i always get all of the post. $student_query_args = [ 'post_type' => 'student_list', 'post_status' => 'publish', 'posts_per_page' => 100, 'order' => 'DESC', 'meta_query' => [ 'key' => 'program_id', 'value' => 5317, ], ]; …
Category: Web

Combining two separate confusion matrix results from two seperate machine learning model to overall increase the True Positive accuracy

What are the steps involved if it is possible to add two confusion matrix results together to get a better final prediction. we have calculated two confusion matrixs as follows from naive bayes and the decision tree True positive totals and lessen the False negatives.
Category: Data Science

How to train neural word embeddings?

So I am new to Deep Learning and NLP. I have read several blog posts on medium, towardsdatascience and papers where they talk about pre-training the word embeddings in an unsupervised fashion and then use them in supervised DNN. But recently I read a blog post which suggested that training the word embeddings while training the neural network gives better results. This is the other link. So my question is which one should I follow? Some YouTube videos that I …
Category: Data Science

How to set From filed in contact form 7 Use Mail (2) auto responder

I'm trying to set a contact form on my site but have a little problem with the auto responder (use mail 2) the From field. I'm testing it by myself so i act like an admin and a user on two different emils. When the filed is set to: [your name] <[your-email]> it throws an error: Sender email address does not belong to the site domain That's ok. But even when set to: [email protected] it goes to the sender junk …
Category: Web

Number and size of dense layers in a CNN

Most networks I've seen have one or two dense layers before the final softmax layer. Is there any principled way of choosing the number and size of the dense layers? Are two dense layers more representative than one, for the same number of parameters? Should dropout be applied before each dense layer, or just once?
Category: Data Science

Approaches to fit a theoretical model on a physical device

Happy to join this community. Thank you in advance for your kind help! :) Intro I have a physical device characterized by its internal parameters, of which I know the nominal values. I also have the theoretical model of the device, that differs from the physical device because fabrication tolerances change the internal parameters. I would like to extract the internal parameters of the device by fitting the model onto it. The device also has additional inputs that alter its …
Category: Data Science

Why does accuracy remain the same

I'm new to machine learning and I try to create a simple model myself. The idea is to train a model that predicts if a value is more or less than some threshold. I generate some random values before and after threshold and create the model import os import random import numpy as np from keras import Sequential from keras.layers import Dense from random import shuffle os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' threshold = 50000 samples = 5000 train_data = [] for i …
Category: Data Science

Add additional first page, last page links to the_posts_pagination()

Is there a way to add additional first and last page links to the pagination object if it is rendere with the the_posts_pagination() method? At this point I have the following the_posts_pagination( [ 'screen_reader_text' => ' ', 'mid_size' => 2, 'prev_text' => __( 'vorherige', 'bdb' ), 'next_text' => __( 'nächste', 'bdb' ), ]); and I would like to after prev_text a first page link if is not the first page and a last page link before next_text if is not …
Category: Web

is there a way to check if i got a "good price" on something?

I'm looking at some data. Actually, the Boston Housing dataset is probably a good proxy for it: https://www.cs.toronto.edu/~delve/data/boston/bostonDetail.html I'm wondering if there's a way to predict if I got a "good price" given certain conditions. So something like, if I'm given a tuple such as CRIM, ZN, INDUS = (0.006320,18, 2.31), then is a house price of 50 significantly higher or lower than expected? This isn't quite vanilla anomaly detection, because the combination of a particular CRIM, ZN, INDUS may …
Category: Data Science

How to run select query of post with category and tags?

I want to fetch multiple posts with categories and tags currently I'm using this query: $pagesize = 20; $pageNumber = 1; $mysql = mysqli_query($con,"SELECT p.post_title, p.ID, p.post_content, p.post_date, p.post_name as url, t.name as category_name FROM wp_posts p, wp_terms t, wp_term_relationships r, wp_term_taxonomy tt WHERE p.post_status='publish' AND tt.taxonomy = 'post_tag' AND p.id=r.object_id AND r.term_taxonomy_id=tt.term_taxonomy_id AND tt.term_id = t.term_id ORDER BY p.post_date desc LIMIT ".(int)($pageNumber*$pageSize).",".(int)$pageSize."") or die ("error".mysqli_error($con)); The mysqli-connection works. But when I run this code, I only get a blank …
Category: Web

Time series prediction using ARIMA vs LSTM

The problem that I am dealing with is predicting time series values. I am looking at one time series at a time and based on for example 15% of the input data, I would like to predict its future values. So far I have come across two models: LSTM (long short term memory; a class of recurrent neural networks) ARIMA I have tried both and read some articles on them. Now I am trying to get a better sense on …
Category: Data Science

Path for contact form file

I have a php contact form that I use with all websites, so ideally I want to avoid using a plug in. The files used include: • contact.php - A file with php/html write up which displays the form fields. • contact-form.php - A file that contact.php connects to to send the information. I've created the equivalent of contact.php as a static page in the Wordpress login. The code within contact.php which connect to contact-form.php is as follows: <form method="post" …
Category: Web

How can deep learning be applied to association rule mining?

Association rule mining is considered to be an old technique of AI. Rules are mined on statistical support. How can deep learning be applied to this? What are approaches for structured data (in a graph format like XML)? XML documents are structured by tags. My goal is to extract a rule that says that tag x is often combined with tag y and z. Then, I later want to apply these rules and if a tag y and z is …
Category: Data Science

Finding the screen id of a page generated with add_menu_page

I'm at a basic level of WordPress + PHP and I'm trying to build a pretty simple plugin. I've set up the plugin correctly, and the plugin page is generated with function wpplugin_settings_page() { add_menu_page( 'Modal Generator', 'Modal Generator', 'manage_options', 'modal-slug', 'wpplugin_settings_page_markup', 'dashicons-format-gallery', 100 ); } Whereas wpplugin_settings_page_markup is a function that generates my HTML on the plugin page. I copy-pasted a code to create/generate metaboxes and they work great. I can get them to show on posts & pages …
Category: Web

Gravity loss after settling?

Just made my second batch using an Anvil Foundry all-in-one brewing system. I used an immersion chiller to bring the wort down, but could only get it down to 82F (groundwater in Texas in August... whatya gonna do?). I didn't want to pitch my yeast at >80F, so I decided to seal it up and leave it overnight to cool to room temperature. This morning, I decided to use the pump that came with the Anvil to pump the wort …
Category: Mac

How to override theme's public static function inside of a trait?

I use a theme which has a public static function to display a part of a page like: trait SomeTrait { public static function some_function() { ?> <div class="some_class">Some content</div> <? } } and the helper file looks like: class Helper { use SomeTrait; // ... } I need to override the function in my plugin. In the plugin I try the code: /* Plugin Name: MyPlugin Description: - Version: 1.0 Author: - */ if ( ! defined( 'ABSPATH' ) …
Category: Web

Designing a pretrained DNN for image similarity

I am pretty new to deep learning and really hope that you can help me. I want to write a python program that lets me choose an area in a reference image. This subimage of variable size should then be used to search in a database of images. Then the parts of the images with the highest similarity to the reference sub image should be given. However I have big problems with the sizing of the reference and database images. …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.