calculation of average ROC in IMageNet paper?

The IMageNEt paper Image Net. presents the Average ROC curve for the 16 classes in the imagenet data, visit image figure. 8 in the paper. what is the known function to compute this ROC plot. As ROC plot is for a binary classification problem. Is this average ROC plot made in the picture average of ROC's for all the 16 categories. Any Help would be appreciated.
Category: Data Science

MULTISITE: Password issue and Error Cant access site

I have recently installed Wordpress Multisite on my domain https://matrixsolutionsnetwork.com. I haven't had any issues at this point with the installation. I successfully added the SEO and Security components to the foundation of the network and added a subdirectory. Last night I was able to start working on the homepage of the main network site. Saved and went to bed. This morning I sat at my computer and saw the login popup. When I attempted to login back i got …
Category: Web

Best method of implementing compartmentalized custom post types on a multi-site network

I'm aware that there are many different ways to implement custom post types on a multi-site network, however, I'm unsure as to the best method to do so for my application. I have a website with multiple subdomains that are only accessible by users with specific user roles. Each subdomain will have a set of custom post types that the users can create and edit from a front end dashboard, but I need many of them to be accessible on …
Category: Web

Using delete_attachment to prevent an attachment not working

I'm having an issue where the attachment is being deleted despite me returning false function action_maybe_delete( $id ) { echo "Let's not delete Attachment id: " . $id ; // prevent the attachment from actually being deleted if( 1 == 1 ) { // made up condition return false; } }; // add the action add_action( 'delete_attachment', 'action_maybe_delete', 10, 1 ); When i run code similar to the above from the media library, it calls admin_ajax.php it echos the mesage …
Category: Web

how to set threshold value by looking at loss distribution in anomaly detection task

I am following this tutorial https://towardsdatascience.com/lstm-autoencoder-for-anomaly-detection-e1f4f2ee7ccf to use LSTM autoencoder to detect anomalies in my unsupervised dataset. they plotted loss distribution and i plotted the same loss distribution on my dataset. given in image below my question is how they are setting the threshold value by looking at the loss distribution. i also want to set threshold by looking at my loss distribution but not clear how can i select threshold. they are saying in tutorial "By plotting the loss …
Category: Data Science

How to get the term id inside the start lvl method of category walker?

I'm trying to implement the category walker with wp_list_categories to help me manipulate list classes, which i want to get the term id within the start_lvl method, so i tried to use $category->term_id but errors thrown. now i just want to get the term id inside the start_lvl method to match the one i used inside the start_el output, please check this line in the following class $output .= "<span id=\"$category->term_id\" class=\"toggle\" onClick=\"toggleMe(this.id);\" style=\"cursor:pointer\">&#9660</span>"; I just copied the Walker_Category class …
Category: Web

getting actual concepts value instead of its URI in ontology

I am using owl ontology for semantic analysis in emotional sentiment analysis project , I am trying to navigate the ontology to check a concepts and its relation , my ontology has classes like this : <!-- http://purl.obolibrary.org/obo/MFOEM_000011 --> <owl:Class rdf:about="http://purl.obolibrary.org/obo/MFOEM_000011"> <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/MFOEM_000001" /> <rdfs:subClassOf> <owl:Restriction> <owl:onProperty rdf:resource="http://purl.obolibrary.org/obo/BFO_0000117" /> <owl:someValuesFrom rdf:resource="http://purl.obolibrary.org/obo/MFOEM_000208" /> </owl:Restriction> </rdfs:subClassOf> <obo:IAO_0000115>An unpleasant emotion closely related to anger but lower in intensity and without the moral dimension of blame and seriousness that is implicated in anger. [Source: …
Category: Data Science

keras: what do we do when val_loss and loss differ markedly?

I am new to Deep learning. I want to understand when it is a good time to stop training and the tweaks that should be made. Thank you. 1) I understand that if val_loss increases but val is flat, we are over-fitting. Eg in Image 1: So do we tweak the network to be less complex (eg reduce the layers, neurons), or reduce the epoch? 2) If both the val_loss and loss have flatten, but the val_loss remains above the …
Category: Data Science

Send mail to author when custom post type is saved

I have a custom post type called "documents". I can add documents (ACF repeater field) there and the users can see them in a frontend-view. Now i need to send an email-notification to the author of the post when i change the custom-post-type in the backend and save it. In another project i worked with the following function in the functions.php file, but this code is just working when i create a new post. I don't need to send mails …
Category: Web

Create a new table on the database and save parameters from a contact form

I have a wordpress function in functions.php which gets parameters from a form I made and gets parameters like IP addresses and UTM tags (from the URL) and sends them to me by email. I want to get all these parameters I send and store them in a new table on my WP database. How can I do such thing? I researched it and found a lot of plugins that can do that for me (Which I really don't want …
Category: Web

Does it makes sense to train the model on whole data?

Suppose I am training an lstm model on a stock price data. So for first iteration say I have trained it on 80% of data and then tested it on rest of the 20% data and got the rmse value. Now after this does it makes sense to again train it the whole data before predicting the value? Example i have data for aapl from 2010 to today and I have trained it on 2010 to 2020 and tested on …
Category: Data Science

Support Vector Regression trained with data sets

I am now searching for a long time on the internet and on papers for an answers of simple questions. Am I able to train a Support Vector Regression algorithm with different data sets? If yes, how is the approach called? I have 10 times the same battery with different usage, temperature and capacity. Usage and temperature are features (x_i,i) and capacity is the output (y_i,i). Battery_1 till timepoint n: [x_1,1 y_1,1; ... ;x_1,n y_1,n] ... Battery_10 till timepoint n: …
Category: Data Science

In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?

As it stands right now, in WooCommerce 3.5.1, at product archive (the /shop page), if you use the +/- buttons to set a quantity before clicking "Add to cart", all is fine. But if you try to actually type it in the input#quantity field instead of using the buttons, it adds just one product to cart. This plugin seems to not have the issue, for single products: https://wordpress.org/plugins/woocommerce-ajax-cart/ This guy has done something similar for the cart page: https://businessbloomer.com/woocommerce-automatically-update-cart-quantity-change/ Using …
Category: Web

Unable to properly load Wordpress Admin page

I'm trying to fix a website for a company I used to work for. It looks like the CSS has been stripped from the page (won't load in any browser, I've tried multiple), the Wordpress theme I had installed is no longer functional, and the wp-admin login page that used to show is no longer loading - there is an ERR_NAME_NOT_RESOLVED that displays when I try to load the login page, and looking in the console on the homepage shows …
Category: Web

Transfer Deep Learning from one aerial imagery datset to many others

I am new to Deep Learning but have been able to use RasterVision successfully to predict building footprints within a set of aerial imagery. This aerial imagery data set is for a province of New Zealand. Now that I have a model that predicts successfully in this province, I am interested in how I could use this to predict in the many other regions of New Zealand. The problem is these regions are captured with differing sensors, resolution and with …
Category: Data Science

Hide Heading if ACF Field is empty

I am trying to add a "Local FAQ" section to all the individual location pages on a site with literally thousands of individual location pages. I am doing this by using ACF field in the custom post type. I've implemented this in a staging site. To give the local FAQ section a heading as opposed to there just being a list of questions & answers, I added a h3 as seen below <h3 class="local_faq" style="text-align: center; font-size: 50px;"><?php the_title(); ?> …
Category: Web

Registration key

I want to make my single wordpress installation a closed community. Only people who know the registration key should be able to sign up. I already added some more fields to the registration form but I can't fin a simple solution for the registration form to check if the code is correct!? Looking forward for some ideas! Thank you! Here's what I do have until now: // This function shows the form fiend on registration page add_action('register_form','show_first_name_field'); // This is …
Category: Web

Making predictions / Loading model in TensorFlow 2.0

I use TensorFlow/Keras on a daily basis to make predictions for a project. Everything works fine but I was getting regular warnings about the transition to TensorFlow 2.0 and I thought this week I would finally make sure my code works in the new version of the library as well. I did not encounter any problems during training or saving a model, but when it comes to making predictions I got the following warning: WARNING:tensorflow:Your input ran out of data; …
Category: Data Science

Where to add_filter in theme functions.php?

I am new to Wordpress and want to make some changes in the content of a plugin page. I have found out that the same can be done using add_filter I have the filter value for the plugin content that I want to change. I am using the storefront theme. So I open the storefront_functions.php , but I am not sure where to add the code snippet. Seeking guidance/suggestions regarding the same. Thanks
Category: Web

Does `viewScript` in `block.json` actually enqueue a js file?

If I have declared, viewScript in my block.json file. Do I need to enqueue the script manually within my register_block_type(); function also? (I didn't think it was necessary for 5.9?) My Block.json "textdomain": "postcode-pricing-wizard", "editorScript": "file:./index.js", "viewScript": "file:./view.js", "style": "file:./style-index.css" My Problem I've enqueued the script, as shown above, I can see a completed build directory and I can also see my block within the editor. view.js However, isn't loading for me on my front-end? I'm not too sure why? …
Category: Web

problems with alt text not appearing in source code

I have added alt tags, title and description of all the images on my website but many do not show up when I check them in the inspect element tool in chrome or FireFox. SEMRush states over 900 images do not have alt tags! For example, the image on my homepage www.medispera.com in the code it states alt="image" instead of the alt text appearing. Please advise how to fix.
Category: Web

How to estimate missing values when calculating NDCG

I would like to compare recommendations methods using NDCG metric on MovieLens dataset. In ranking problem, the goal is to rank items based on their relevance for user. Ranking models can be learned based on ratings matrix, where each user rates small subset of all items. Ratings for other items are unknown. Collaborative Filtering methods can be used to create model which generalize training datasets and predict ratings for unrated items. Let's consider following example on dataset consisted of 5 …
Category: Data Science

Multioutput Neural Network for function approximation

I am trying to extend the example here to be capable of handling multiple outputs for function approximations import numpy as np # helps with the math import random as r import plotly.graph_objects as go # full data set x = np.linspace(0, np.pi, 100) y = np.sin(x) # input data p = 1/2 # fraction of data to use in training N = int(len(x)*p) # number of data points in the full set that corresponds to above fraction idx = …
Category: Data Science

How to fire a disabled WooCommerce New Order notification?

I have the admin or store owner emails disabled but would like to programmatically fire the action so that once a function runs using AJAX to finalize an order I can send the email as intended, but only after an AJAX function that is fired on the return of the reciept page after payment. The flow is as follows currently: Add to Cart -> Cart -> Checkout -> Reciept Page (disabled new order email here) -> Redirect to Payment -> …
Category: Web

Difference in model performance measures of train and test data sets

I am using CART classification technique by dividing a dataset into train and test sets. I have been using Mis-classification error, KS by rank ordering, AUC and Gini as MPMs(model performance measures). The problem I am facing is that the MPM values are quite far apart. Dataset Metadata I have tried with minsplit equal to anywhere from 20 to 1400 and minbucket from 5 to 100 but couldn't get expected results. I have also tried oversampling/undersampling through ROSE package but …
Category: Data Science

How do I replace a render_callback function for a block?

I like to basically use a modified version of the below function. There is pre_render_block and other filters. I have not found out how to get attributes and context the exact way that function does. https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes/blocks.php I see how I can filter the context there how the file adds the global $post->ID to the block context, but I do not get what filter I am supposed to use to get whatever is in context. The GB functions needs $block->context['queryId'] Am …
Category: Web

Unsynchronized time series visualization

I would like to visualize a large amount of events composed of time serie windows. A typical event would be: Problem is, my events are not synchronized, and so if I plot them all, it would look like: Question Is there any way to visualize all my events so I can see their original/"typical" shape (preferably in the time domain) despite their unsynchronization ? What I have tried so far: Visualize features: approach is good but I have to guess …
Category: Data Science

Share media among different domains

I have multiple Wordpress instances that live on separate domains (not a multisite installation). Since they provide the same content in different languages I'd like to share the images among these instances. Ideally these Wordpress installations would share the same Media Library so that I have to upload the files only once and they would be available on the other site as well, even served by the same CDN and sharing the same URL. So for example I upload Image1.jpg …
Category: Web

Programmatically creating site in a network

Goal Create multiple, predefined sites using wordpress multisite on plugin activation. Current Code $domains = array('however', 'many', 'hardcoded', 'subdomains',); foreach($domains as $domain){ $meta = array( 'public' => 1, 'WPLANG' => '', ); $newdomain = $domain . '.' . preg_replace( '|^www\.|', '', get_network()->domain ); $user_id = get_option('admin_email'); $id = wpmu_create_blog( $newdomain, get_network()->path, $domain, $user_id, $meta, get_current_network_id() ); if ( ! is_wp_error( $id ) ) { update_user_option( $user_id, $domain, $id, true ); } } } Current Functionality The code creates the sites …
Category: Web

Knowing Feature Importance from Sparse Matrix

I was working with a dataset that had a textual column as well as numerical columns, so I used TFIDF for the textual column and created a sparse matrix, similarly for the numerical features I created a sparse matrix using scipy.sparse.csr_matrix and combined them with the text sparse features. Then I'm feeding the algorithm to a gradient boosting model and doing the rest of the training and prediction. However I want to know, is there any way I can plot …
Category: Data Science

How to predict past test set on time series data using LSTM

I'm trying to do a regression on some inventory amounts with the following model using Keras: model = Sequential() model.add(LSTM(100, batch_input_shape=(BATCH_SIZE, TIME_STEPS, X_train_timeseries.shape[2]), dropout=0.0, recurrent_dropout=0.0, stateful=True, kernel_initializer='random_uniform')) model.add(Dropout(rate=0.5)) model.add(Dense(20, activation='relu')) model.add(Dense(1, activation='sigmoid')) optimizer = optimizers.RMSprop(lr=LEARNING_RATE) model.compile(loss='mean_squared_error', optimizer=optimizer, metrics=['mae']) I have a time step of 60, how do I predict past my test data to make actual predictions into the future?
Category: Data Science

How to handle my row actions on a custom list table in the admin section

I have set up a plugin that because of the amount of data being used I set up a custom table and have extended the WP_List_Table class. I know that is not recommended, but Custom Post Types just won't offer what I need. I plan on including a copy of the WP_List_Table class when releasing this project to prevent any unwanted bugs... Anyhow, I have the following code and have went through a lot of tutorials on extending the WP_List_Table …
Category: Web

Additional file upload in Gutenberg page options/featured image

I would like to add an additional image upload in the featured image part of the Gutenberg page options editor. e.g. as in the image below, but with an additional file upload area. In my PHP file I currently have these lines to import a javascript function to add an additional dropdown, that looks like the below. (Code based off this post) I have tried to add a file form upload component, but this a) isn't displayed, and b) I'm …
Category: Web

About

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