h3r | Uber 's h3 bindings to the R Programming Language | Map library
kandi X-RAY | h3r Summary
kandi X-RAY | h3r Summary
Uber's h3 geographical indexing library bindings for the R Programming Language.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of h3r
h3r Key Features
h3r Examples and Code Snippets
Community Discussions
Trending Discussions on h3r
QUESTION
I'm doing a regression that is working but to improve results I wanted to add a numpy array (it represents user attributes that I preprocessed outside the application).
Here's a example of my data:
...ANSWER
Answered 2021-Feb-09 at 05:02You are trying to pass nested list/array objects as a feature to convert to tensor. That's the reason for the error. You can handle it at pandas
level by simply converting the n length lists/arrays to n columns (check solution 2). However, usually, when working with such columns, you ideally want to process them differently in the network (such as pass this column into an LSTM for example). Therefore an ideal way is to have a multi-input model
, which is usually how we work with these features in the industry (check solution 1).
This is a fairly common problem especially when we are working with multiple sequences of data or multiple encodings.
One straightforward method of solving this is by creating separate inputs for each encoding.
- (Assuming X_train has 9 columns) Pass 8 columns out of the 9 to the first input, and the encoding (column with list/array) as a separate input.
- Concatenate these to create an
8+398
length tensor which now passes through the computation graph. - The single series with lists can be converted to a tensor/np.array by
np.array(df.column.tolist())
. This will convert the(398,)
length series with lists to a(398, 398)
shaped NumPy array. - Now, you can handle the features and the encodings separately as well before concatenating them and passing them through Dense layers. E.g passing the second input via LSTM layers.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install h3r
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page