How to represent the number of neurons in an LSTM for architecture schematic?

I'm trying to visualise a neural network schematic and found a great tool for building schematics here http://alexlenail.me/NN-SVG/index.html. I've edited the SVG file to change one of the dense layers into a LSTM layer, and the input to time series instead of singular neurons. At the bottom of the image there is some set notation detailing how many neurons is in each layer. I'm not too familiar with set notation. I'm not quite sure how to represent the LSTM layers …
Category: Data Science

Session alternative for plugins (due to caching)

I'm building a plugin that picks a random post from the database and delivers the result dynamically to the user. For certain aspects I need to know the post ID that's been randomly selected. Session data would work perfectly for this if it weren't for website caching. When a site is cached, the post that is supposed to load dynamically, based on the session data, doesn't load anything. What alternatives do I have to using $_SESSION?
Category: Web

Gutenberg add extra attributes to custom format

I'm creating a custom format (adding a custom option to the format toolbar) using the following guide: https://developer.wordpress.org/block-editor/how-to-guides/format-api/ import { registerFormatType, toggleFormat } from '@wordpress/rich-text'; import { RichTextToolbarButton } from '@wordpress/block-editor'; const MyCustomButton = ( { isActive, onChange, value } ) => { return ( <RichTextToolbarButton icon="editor-code" title="Sample output" onClick={ () => { onChange( toggleFormat( value, { type: 'my-custom-format/sample-output', } ) ); } } isActive={ isActive } /> ); }; registerFormatType( 'my-custom-format/sample-output', { title: 'Sample output', tagName: 'samp', className: null, …
Category: Web

'Solvers' in Machine Learning

What role do 'Solvers' play in optimization problems? Surprisingly, I could not find any definition for 'Solvers' online. All the sources I've referred to just explain the types of solvers & the conditions under which each one is supposed to be used. Examples of Solvers - ['Newton-cg', 'lbfgs', 'liblinear', 'sag,' 'saga']
Category: Data Science

AUC-ROC for Multi-Label Classification

Hey guys I'm currently reading about AUC-ROC and I have understood the binary case and I think that I understand the multi-classification case. Now I'm a bit confused on how to generalize it to the multi-label case, and I can't find any intuitive explanatory texts on the matter. I want to clarify if my intuition is correct with an example, let's assume that we have some scenario with three classes (c1, c2, c3). Let's start with multi-classification: When we're considering …
Category: Data Science

Validating classification results

I created a model for only 2 classes and the classification report was: Although accuracy looks good, I don't think this model is good. The original data has 522 records of class 1 and 123 of class 2. So, I think that the model is guessing for the most common (class 1). When I applied the model on the original data, it was predicted 585 class 1 and 60 class 2. When I balanced the classes, the results were: The …
Category: Data Science

Interpretation of learning curve - neural network

When I run my three different neural networks I obtain the following learning curves using MSE. I believe that my model base is okay and is not overfitting or underfitting. Furthermore, I believe that my model small is underfitting due to high training error and high validation error. However, I'm not sure about model big. Taking the square root of the MSE the RMSE of both the train set and validation set in model big is lower than model base. …
Category: Data Science

Create action running on trashed_post hook to modify post_meta value

I have a custom post type that always do math operation to its post_meta and other custom post type post_meta. For example: post-type 1 = cpt_product_order post-type 1 post_meta = cpt_pm_product_order post-type 2 = cpt_product post-type 2 post_meta = cpt_pm_product_stock There's a cpt_product with cpt_pm_product_stock = 100, frontend operation enable specific user made order by inserting new cpt_product with post_meta cpt_product_order of 10 will substract cpt_pm_product_stock to 90 100 cpt_pm_product_stock - 10 cpt_product_order = 90 cpt_pm_product_stock cancelling order will delete/trash …
Category: Web

Multiple domains using same WordPress, set specific uploads folder

For a project at my office I have 3 websites ending in ".nl", ".de" and ".com". They all end in the same folder but don't all have the same images and uploads. My folder structure is like this: - / | - wordpress | - wp-content | - uploads | - themes | - plugins | - index.php | - wp-config.php Everything was working fine until I changed the uploads directory for the uploads with this line: const UPLOADS = …
Category: Web

Order by the first array within a meta_query

I would like to sort the output of my WP Query. I want the events that are coming up soon to be at the beginning. The events that have already taken place should be at the end. So the first array in my meta_query should be output first, then the second array. $the_query = new WP_Query( array( 'post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => $posts, 'meta_key' => 'datum-von', 'orderby' => 'meta_value upcoming_events', 'order' => 'ASC', 'post__in' => array(22888,23062,23065,23348), 'meta_query' …
Category: Web

new post link leads to 404 error page

Whenever I try to add new posts or pages, or edit posts or pages from the admin menu, from the front end or even from the all posts and all pages lists, I can't. I'm always taken to a 404 error page. How can I fix this? Wordpress was installed in English, installing in Spanish results in same issue. Database is UTF-8, PERMALINKS ARE NOT THE ISSUE (I've set and reset them to try and fix as I've seen other …
Category: Web

Remove tinyMCE from admin and replace with textarea

I have created a plugin wherein I have a custom post type. I am using post_content for some simple text. I do not need to offer any fancy editing or insertion of data for this field, so I looked for a way to remove the buttons from the tinyMCE editor. I never found a very good solution so I removed the editor from the custom post type supports in the register function. 'supports' => array('title','revisions','thumbnail'), Then to create an area …
Category: Web

Logistic Regression for prediction

I would like to ask about the theoretical approach of using Logistic Regression for customer data and more specifically Churn Prediction (in BigQuery and Python). I have my customer data for an online shop and I would like to predict if the customer will churn based on some characteristics. I have created my dataset and the Churn label (based on the hypothesis that if the customer hasn't bought something in the last year then it is assumed that the customer …
Category: Data Science

Show count of all comments by meta_value from a users posts

I'm trying to display the total number of comments for a users posts limited to a comment meta. I've tried using both get_comments() and WP_Comment_Query() but I get the same result of "1" for the comment count when it should be "3". Now in this example I can remove 'Count' => true and just loop through the comments and that will return the correct amount of comments in a loop but the count still equals one. They provide an example …
Category: Web

Display full WordPress post under search form using AJAX

Hi I am currently creating a site that shows interactions between different pharmaceutical drugs. I originally started with Live search on JSON Objects Data Using jQuery (originally based on this article: https://www.js-tutorials.com/jquery-tutorials/live-search-json-objects-data-using-jquery/ but modified slightly below) however the client must be able to add constant content and a JSON file was too difficult for them to edit. I am now creating a page for each drug as a WordPress post (and perhaps use a tag to distinguish it for search) …
Category: Web

is it good to have 100% accuracy on validation?

i'm still new in machine learning. currently i'm creating an anomaly detection for flight data. it is a multivariate time series data that include timestamp, latitude, longitude, velocity and altitude of the aircraft. i'm splitting the data into train and test with 80% ratio. i used the keras LSTM autoencoder to do a anomaly detection. so here's my code def create_sequence(data, time_step = None): Xs = [] for i in range (len(data) - time_step): Xs.append(data[i:(i + time_step)]) return np.array(Xs) # …
Category: Data Science

how to filter the data's comparison operators (>= & <=) & range between values using the WP REST API

I'm quit new for wordpress development. Working with property management website with mobile API Development. Here need to filter the data's for based on conditions like greater than and less than &amp; between range. For example need to filter and search the data's where price filter range and between and greater or less than bedrooms. Kindly help me to solve this issue.I've tried below example but not works to me http://192.168.0.88:8825/wp-json/wp/v2/properties?filter[meta_key]=property_bathrooms&amp;filter[meta_value]=4&amp;filter[meta_compare]=&gt;=&amp;filter[meta_key]=property_bedrooms&amp;filter[meta_value]=5&amp;filter[meta_compare]=&gt;=&amp;filter[meta_key]=property_price&amp;filter[meta_value]=5,500&amp;filter[meta_compare]=between
Category: Web

save_post_{CPT} not updating the 'sticky_posts' option

add_action( &quot;save_post_{CPT}&quot;, 'update_sticky', 15, 1 ); function update_sticky( $post_id ) { $stickies = get_option( 'sticky_posts' ); if ( ! in_array( $post_id, $stickies ) ) { $stickies[] = $post_id; update_option( 'test', $stickies); update_option( 'sticky_posts', $stickies ); } } It does work for test option I created for testing, but it doesn't work for existing sticky_posts option, although everything is the same. It does work for both if I hardcode the $post_id, like: $stickies[] = 123; Tried it in functions.php file, as …
Category: Web

Identifying potential customers based on their Rank and Value

I have a dataset which has demographic data available for a list of new customers. the data does'nt include transaction data of the customers. I want to identify the top 100 potential customers among these customers. Im aware that we can make use of clustering to segment these customers.However, I have two more variables in my data which are Rank and Value. What approach should be taken when rank and value of customers are given.How do we interpret the clusters …
Category: Data Science

How do I order pages and categories by ID or name in the same query?

I would like to query most of my pages and categories on the homepage. So far I am able to get the pages and category (posts), but I cannot order the list the way I want to. I want to be able to get a custom order like page, posts from a category, another page, and posts from another category. I am using the following: &lt;?php $args = array( 'cat' =&gt; $current, 'post_type' =&gt; array( 'page', 'post'), 'orderby' =&gt; 'ID' …
Category: Web

Analysis of probability distribution of each features and Machine Learning

While I know that probability distributions are for hypothesis testing, confidence level constructions, etc. They definitely have many roles in statistical analysis. However, it is not obvious to me now how probability distributions come in handy for machine learning problems? In ML algorithms, they are expected to automatically pick up distributions from dataset. I wonder if there are any places of probability distributions in better solving ML problem? Shortly put, how could statistical techniques related to probability distributions can benefit …
Category: Data Science

How to extract and classify data from a column in excel?

I have a column in an Excel sheet that contains a lot of data separated by || delimiters. The data can be classified to some classes like Entity, IFSC codes, transaction reference id, etc. A single cell looks like this: EFT INCOMING||0141201||NHFI0141201||UTR||SBIN118121948660 M S||some-name ||some-purpose||TRN REF NO:a1b2c3d4e5 Not every cell has the same number of classes or even the same type of classes. Another example: COMM/CHARGES/FEES||CHECK/REF.6546644473||BILPAY CCTY BEARING C||00.00||00012||18031358||BLPY||TRN REF NO:a1b2c3d4e5 I tried extracting this information using regular expressions and …
Category: Data Science

Editing featured image

How can I edit the featured image? Usually I upload the image in media, there is one option which says "use as a featured image". This works fine but the output image is badly cropped. I want to know how can I manually crop it (150 x 150) and use that a featured image?
Category: Web

Linear Regression Coefficient Calculation

class LR: def __init__(self, x, y): self.x = x self.y = y self.xmean = np.mean(x) self.ymean = np.mean(y) self.x_xmean = self.x - self.xmean self.y_ymean = self.y - self.ymean self.covariance = sum(self.x_xmean * self.y_ymean) self.variance = sum(self.x_xmean * self.x_xmean) def getYhat(self, input_x): input_x = np.array(input_x) return self.intercept + self.slope * input_x def getCoefficients(self): self.slope = self.covariance/self.variance self.intercept = self.ymean - (self.xmean * self.slope) return self.intercept, self.slope I am using the above class to calculate intercept and slope for a Simple Linear …
Category: Data Science

Better way to list links with different meta values using same meta key?

This works, but I will need it to make 8 different lists on the page, using same meta key but 8 different meta values. Is there a more efficient way to achieve this rather than repeating the same code 8 times? &lt;?php $posts = get_posts(array( 'numberposts' =&gt; -1, 'post_type' =&gt; 'page', 'meta_key' =&gt; 'my_meta_key', 'meta_value' =&gt; 'meta_value_1' )); if( $posts ): ?&gt; &lt;h4&gt;Pages with Meta Value 1:&lt;/h4&gt; &lt;ul&gt; &lt;?php foreach( $posts as $post ): setup_postdata( $post ); ?&gt; &lt;li&gt; &lt;a …
Category: Web

Comment Table Size Results in Slow Page Loads and 500 Errors

I manage a small site that has a very active comment area. The site is on shared hosting. There is a daily post entry, then a robust comment area. It is not untypical to have more than 100 comments on a day's post. The result is that loading or refreshing the current day's page is very slow - up to or more than 30 seconds. Sometimes a page load will time out with a 500 error. Other times a comment …
Category: Web

Should I take the entire dataset for Linear Regression Model Training

I am new to the data science and wanted to develop a Linear Regression model to identify important factors to predict a policy holder makes a insurance claim. There are around 750,000 active policy holders in the books and each policy holder details can extract as a row along with factors. What I would like to know, should I take entire 750,000 rows of data and split 70% &amp; 30% for training and testing ? Regards, Mira
Topic: python
Category: Data Science

Ajax call from Plugin using Class

I'm making a plugin with a class and methods. This class gets called through the theme ( hard coded ) to enqueue and localize my js. it also prepares it for ajax. However, i keep getting ERROR: 400 POST http://www.devsite.local/wp-admin/admin-ajax.php 400 (Bad Request) I've ran ajax outside of a class in multiple plugins and at the functions.php with no issues, but i can't get it to work inside a class. This is my code: class CCYTFeatured { public function __construct(){ …
Category: Web

MLP classifier Gridsearch CV parameters to tune?

I'm looking to tune the parameters for sklearn's MLP classifier but don't know which to tune/how many options to give them? Example is learning rate. should i give it[.0001,.001,.01,.1,.2,.3]? or is that too many, too little etc.. i have no basis to know what is a good range for any of the parameters. Processing power is limited so i can't just test the full range. If anyone has a general guide of which are the most important to tune and …
Category: Data Science

About

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