How do I get the "Ideal Characteristics" of a candidate for least attrition in Machine Learning?

I am working on a project to predict whether a candidate, after joining our organization, would leave us within 1 year or not. The model is based on different features present in their resumes (average tenure, skills, degree, etc.) and features of our organization (job role, place, supervisor, etc.) The aim is to get the ideal characteristics of a candidate who won't leave within a year. This information can be then handed over to HR for better recruitment in the …
Category: Data Science

Can you link custom post types to pages?

The reason i ask is because when i create pages they don't insert the usual name of the post type like CPT's do. For example if i create a page called toyota the URL would be http://domain.com/toyota, but if i created a custom post type to Enter all the makes one page with custom links to specific pages within my site and say that CPT was called Cars then the URL would look like this http://domain.com/cars/toyota and therefore wouldn't properly …
Category: Web

Classification problem using features with unequal sizes

I am relatively new to Machine Learning/ Deep Learning and currently I am working on a classification problem. I have many 2D images and each of them is a cross section of a specimen showing the deformation after applying a load. The images show the edges of the specimen with the same color and the deformed edges are shown with different colors. I want to use the values of pixels as one of the feature to my classification problem. At …
Category: Data Science

ML model shooting up prediction probabilities

I have a scikit-learn logistic regression binary classifier and tried training it on my dataset. My model does extremely well at a threshold of 0.95 instead of 0.5 and all my predictions on example cases are above 0.8 for both classes. I cannot figure out why my machine learning model is shooting up predictions so much. I would appreciate some potential work arounds for this.
Category: Data Science

Interval segmentation of time series data

I have this attached time series signal (its actually from an electrostatic sensor, everytime someone walks or moves, I can see that in the signal). For the machine learning part, I would like to get only the signal when someone is walking or something, so when the signal passes a certain threshold for example. How do I get to do that in C language?
Category: Data Science

R and Tableau Integration Calculated Field - Mann-Kendall Test

I am trying to detect a monotonic increase or decrease in the rate of ED visits over a 6 month time period (using monthly rates). I would like to see the p-value in the tool-tip when hovering over the point in a line graph on a dashboard. Could someone assist with the creation of a calculated field to achieve this? First, I am trying to figure this out using sample data of yearly rates, but I keep getting this error …
Topic: tableau r
Category: Data Science

Mixed Data Type Classification / Neighbor Algorithm

Here is a hypothetical simplified dataframe of my problem, which would be low dimensional (20ish features), containing some made-up information about certain dog breeds: Breed Min_Weight Max_Weight Min_Height Max_Height is_friendly grp Husky 10 20 30 35 True working Poodle 8 17 15 30 False terrier The algorithm would receive some information about a dog, and it would need to identify k-closest dog breeds based on the input data. It needs to be high performance. Example: algorithm receives an unknown breed …
Category: Data Science

How can we predict a value after several rows of data?

I have a regression problem in which for each week I have several rows (variable between rows i.e 1 week might have 1800 rows and other might have 5000 rows). My target is to predict a value at end of each week's data. Here's an example of what I need : x is a feature y is the target. Week 1 ; x1, x2, x3.. x90 Week 1 ; v1, v2, v3... v90 .... 100 more rows Week 1 ; …
Category: Data Science

How do I stack copies of a 1D tensor in keras?

I have a tensor x of shape (5, 1). I would like to stack 10 copies of it so that I get a tensor of shape (5, 10). In a sort, it would look like [x|..|x]. How to do it the keras way? I have tried the Concatenate layer, but I got an error. Help is welcome!
Category: Data Science

How to remove a sub-menu using walker hooks/filters without relying on a custom walker?

I currently built a pretty simple tool to create a mega menu. I add a checkbox to my menu items in the Appearance > Menus section followed by a dropdown that includes template files within the theme. Here's how my current function works (or doesn't work): function mega_menu_start_el( $output, $item, $depth, $args, $id = 0 ) { $is_mega = FALSE; $in_mega = FALSE; if( $depth > 0 ) { $parent_ID = get_post_meta( $item->ID, '_menu_item_menu_item_parent', TRUE ); if( $parent_ID ) { …
Category: Web

Understanding WooCommerce Build-In Geolocation/ Geo_IP classes

I would like to show/hide a fee in the WooCommerce checkout process depending on the location of the user. For this i would like to first use the IP address of the user to determine the location and later the address he enters. I came across the build-in Geolocation ability of WooCommerce with the following classes: WC_Geo_IP (https://docs.woocommerce.com/wc-apidocs/class-WC_Geo_IP.html) WC_Geo_IP_Record (https://docs.woocommerce.com/wc-apidocs/class-WC_Geo_IP_Record.html) WC_Geolocation (https://docs.woocommerce.com/wc-apidocs/class-WC_Geolocation.html) I'm able to get the users IP address with: $geolocation = new WC_Geolocation(); $ipaddress = $geolocation->get_ip_address(); But i …
Category: Web

Is spark als item feature comparable between several runs

I am using spark als.train() to build my user-items recommendation system. The problem is I want to cover more item feature. So, I need to input 7 days user action data. But the als train become slow than just input 1 day data. So, is it possible that I just input 1 day data, and compare the similarities between other runs(every time just input 1 day)?
Category: Data Science

Plotting confidence intervals

For the following dataframe, I am trying to plot the means of a sample of 5 random rows . And also plot their respective confidence intervals using errorbars. I am unable to figure how to plot the confidence intervals using errorbars. col0 col1 col2 col3 col4 col5 col6 col7 0 0 1 2 3 4 5 6 7 1 8 9 10 11 12 13 14 15 2 16 17 18 19 20 21 22 23 3 24 25 26 …
Category: Data Science

Same base for category and post

I'd like to have the following: Single Post test.com/blog/new-category/post-name/ Category test.com/blog/new-category/ So I changed the Permalink structure to: /blog/%category%/%postname%/ and the category base to blog. But this gives me a 404 on the post. So I tried blog/. for the category base, which works. But only for the first page. On the second page it gives me a 404 for test.com/blog/new-category/page/2/. I guess WP is looking for a post with the slug page/2/. Does anybody had a similar problem and …
Category: Web

When using a model like VGG16 as a classifier within Faster RCNN, does Faster RCNN then use 2 CNNs in total?

Im currently doing a project about CNN's but im quite confused because they can be used to classify and to extract features. According to the Faster RCNN paper, it uses a ResNet backbone. I have also seen that you can use for example VGG16 with Faster RCNN to classify,lets say types of vegetables. Does it mean that when I implement it this way, it uses 2 cnn's in total, namely resnet for extracting features of ROI's and then VGG for …
Category: Data Science

Custom RSS does not work for categories and tags

We have a custom RSS in our web. It works normally on Main page and post - https://www.kryptonovinky.cz/feed/spotify But in categories and tags it does not work https://www.kryptonovinky.cz/category/podcasty/feed/spotify redirect to https://www.kryptonovinky.cz/category/podcasty/feed Do you have any idea how to solve it? /* This code initializes the custom RSS Feeds for your website*/ add_action('init', 'customRSS'); function customRSS(){ add_feed('spotify', 'customRSSFunc'); } /* This code seeks the template for your RSS feed */ function customRSSFunc(){ get_template_part('rss', 'spotify'); }
Category: Web

I am looking for general image-based clustering methods

My task is to cluster some images, I decided to use the VGG model to extract the features and then use K-Means to cluster these features. But my question: When I use a VGG as a feature extractor, I should make sure if the VGG model was trained on this type of images before, otherwise, the VGG model is not generalizable to all types of images, am I right? I am looking for a general method to cluster images regardless …
Category: Data Science

Permalinks of New Pages and their Parents

I am running into a new issue where when I attempt to create a new page, the permalink is not being auto generated. For instance On the 'Add New Page' page, I select 'Our Club' as the parent (which has a slug of 'club'). I then type in 'Membership' as the title. However, the permalink that is generated below the text input says www.coolclub.com/membership (instead of www.coolclub.com/club/membership as expected). If, instead of select 'Clubhouse' as the parent of my new …
Category: Web

Extremely slow CNN

I am trying to train a CNN with keras in R. I have a time series that is 3-dimensional, so every sample has dimensions 95 x 365 and has 80 features, which I feed in as channels. The output is only 1 value. The problem is that the net is extremely slow. Training the net for only 1 epoch with 400 samples takes 33 minutes. The architecture is very simple (I actually had a deeper net but since it was …
Topic: cnn keras
Category: Data Science

WordPress All-Import to ATUM Stock Management

When importing and creating/updating products in WooCommerce the fields used in and by ATUM Stock Management doesn't get updated. On the stockmanagementlabs forum one user posted a suggestion to be added to functions.php: add_action('pmxi_saved_post', 'post_saved', 10, 1); function post_saved($id) { // get custom field $purchase_price = get_post_meta($id, '_atum_purchase_price', true); // Insert the field into the database if(isset($purchase_price)){ $wpdb->update( "{$wpdb->prefix}atum_product_data", array( 'column1' => 'purchase_price', 'column2' => $purchase_price ), array( 'product_id' => $id ), array( '%s', '%d' ), array( '%d' ) ); …
Category: Web

Erratic changes in validation accuracy

I am training the binary classification CNN model. It is part of the self-supervised pipeline and I use it to predict whether the transformation has been applied to an image. However, I am getting erratic changes in validation accuracy and loss. Below is a graph that shows how do training and validation accuracy and loss change over the epochs Has this happened to anyone else and could someone diagnose the problem?
Category: Data Science

Metrics for presenting RNN/LSTM result

I am working on two different architectures based on the LSTM model to predict the user's next action based on the previous actions. I am wondering, what is the best way to present the result? Is it okay to present only the prediction accuracy? Or Should I use other metrics? I found a paper using top_K_accuracy whereas on a different paper I found AUC or ROC. Overall, I would like to know what is the state of the art of …
Category: Data Science

Are the weights of a trained neural network repeatable in their convergence?

The question came up whether a neural network will always converge to the same weights if it is retrained repeatedly from the same starting values. Of course this would assume that each repeat shuffled the order of the training data or trained on shuffled subsets of the training data. Is there any convergence proof that would answer this question one way or the other?
Category: Data Science

Using wp_login vs login_redirect to redirect based on user-meta

I wrote a function to redirect first-time users using login_redirect, and it was working great. Then I changed the hook to wp_login (to get it to play well with a social login plugin), and now the function is redirecting all users who sign in via the wp_login_form. PS: the redirect works fine when logging in via my social login plugin. Is there a difference between wp_login and login_redirect, or is something wrong with the conditional php? Here's the code: //Hook …
Category: Web

Imbalanced Binary Dataset in Keras. Finding the best threshold after fit s.t. sensitivity and specificity is maximized?

I have made an ANN in Keras that works on an imbalanced binary dataset. The data is used after fitting the model to predict the binary classes and I want to choose a threshold s.t. sensitivity and specificity is maximized. This is the code that I am using right now, iterating through all thresholds from 0-1 and finding the best one using G-mean score. predictions = model_p.predict(Xt) thresholds = arange(0, 1, 0.001) threshold = -1 best_Gscore = 0 false_positive = …
Category: Data Science

Which stage should the correlation analysis be done?

I was thinking about it, but I couldn't find a logical explanation. Mostly im following below steps after data become ready: Correlation analysis and elimination Apply dummy if categorical variables exist Balance the data if data is unbalanced Scale data Feature selection (Backward, Stepwise etc.) Train model Where would the correlation analysis be applied for this path I followed would make more sense? After the data is balanced? After scaling? Or at first?
Category: Data Science

Definitive wordpress directory ownership and permissions on linux

I know there are a thousand questions about this all over the place and trust me I've been trying every possible solution for years [not an overstatement] and each and every one is either missing a crucial piece or simply doesn't work [in my experience]. I'm looking for a solid, complete, and open minded solution for the wordpress directory user / group ownership and permissions on linux. The requirements are the ones that I think everyone should be looking for: …
Category: Web

How to pad real-valued sequences

I have several sequences of univariate real-valued time-series data. The sequences are of different lengths and right now I cannot batch them and feed them to a network. What is the correct procedure to pad these sequences? Is it even possible in this case since I can't use any number as a special symbol? UPDATE 1 I'm working with arbitrary univariate time-series data (not related to one specific domain, unbounded range). To give example of one such a series consider …
Category: Data Science

prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site

I have seen a number of methods dating back to about 2011 in order to take a form and have its data posted via ajax.jquery. I have tried a couple and am just getting the page to reload despite using preventdefault functions. I am trying to take data from my form, have the jQuery listen for the form submit by targeting the actual form id and then call a PHP function in order to have that data posted to the …
Category: Web

White circles extraction from a little darker background

I'm trying to extract three white circles on the top left corner from the image below: I've tried to use: clone = img.copy() # Threshold grayscaled image to get binary image ret,gray_threshed = cv2.threshold(img,90,100,cv2.THRESH_TRUNC) cv2.imshow('gray', gray_threshed) # Find edges edge_detected_image = cv2.Canny(gray_threshed, 350, 100) # Find contours contours, _= cv2.findContours(edge_detected_image, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE) contour_list = [] for contour in contours: contour_list.append(contour) # Draw contours cv2.drawContours(clone, contour_list, -1, (255,0,0), 2) #Resize image clone = cv2.resize(clone, (800, 800)) cv2.imshow('Objects Detected',clone) The result was: …
Category: Data Science

Unexpected keyword argument error in tensorflow-agents replay buffers

Following the tensorflow tutorial on deep reinforcement learning and DQN. Even after setting up the exact same libraries and running the same code, I am getting some error. from tf_agents.replay_buffers import reverb_utils .... rb_observer = reverb_utils.ReverbAddTrajectoryObserver( replay_buffer.py_client, table_name, sequence_length=2) # This line is throwing error This is the stacktrace TypeError Traceback (most recent call last) Input In [7], in <cell line: 23>() 15 reverb_server = reverb.Server([table]) 17 replay_buffer = reverb_replay_buffer.ReverbReplayBuffer( 18 agent.collect_data_spec, 19 table_name=table_name, 20 sequence_length=2, 21 local_server=reverb_server) ---> 23 …
Category: Data Science

How to create a shortcode for custom page template

I have a custom page template and I want it to display on specific pages. The only way I know to do this is to create a shortcode for this custom page template, so that I can use the custom page template by using shortcode. But I don't know how doing this. I saw some article about this, but I forgot the website link. How to create a shortcode for custom page template?
Category: Web

About

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