Glenda Karen

Ranch Hand
+ Follow
since Oct 02, 2020
Cows and Likes
Cows
Total received
1
In last 30 days
1
Total given
0
Likes
Total received
2
Received in last 30 days
2
Total given
39
Given in last 30 days
39
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Glenda Karen

I have a Stream<Tuple> that outputs something like:

I'm wondering how I can get the value for Index?

So I could get an integer returned that equals 24.

Thanks so much!
1 hour ago
I'm using google-collections-1.0-rc2.jar and guava-28.2-jre.jar which both contain com.google.common.base.

I'm guessing that could be causing the discrepancy.
3 hours ago
Thanks so much!! This worked amazingly!

I converted the Stream<Double>:
Thank you, that make's sense, I am using Eclipse and just importing external jar files, without maven or anything.
5 hours ago
I'm trying to use the Tablesaw library and I'm trying to read a CSV to a Table:

but I keep getting an error:

Here is the stack trace:


Thanks so much!
6 hours ago
I'm using the Smile library and I'm trying to figure out if there is a way to add a List<Double> to an existing dataframe or to make a new one that I can then merge into the old one.

I've searched through the javadoc but I haven't really found anything to do it.

I'm thinking maybe I can add the List<Double> to a text file and then read the text file using Read.csv(TextFIle, format); into a dataframe and then merge it using .merge() but I feel like this would end up being very repetitious and add a lot of unnecessary text files.

So I'm wondering if there is a better way to go about this?

Thanks so much!
No worries, thanks for your help!
3 days ago
Thanks so much for the explanation, really help a lot!

So I tried building it up with terms but I'm encountering a few errors:

1.When I try to construct with terms for ex:


I get:
but I need multiple add terms for calculations.

2. If I just try to add:

I get:


3 days ago
I'm using the Smile library for data science predictions, I'm trying to take a data frame and make calculations for each row.

For ex.


Which I can then use as a new column in  the dataframe:


I tried using the Formula Class but I'm having some trouble getting it to work:

but I'm getting an error:

and went I make Volume and Temp etc. in " " I get:

In the javadoc I see:

lhs
public static Formula lhs(Term lhs)
Factory method. The predictors will be all the columns not otherwise in the formula in the context of a data frame.
Parameters:
lhs - the left-hand side of formula, i.e. dependent variable.


and another place https://haifengl.github.io/quickstart.html I saw:

In the simpliest case, the terms (both of LHS and of RHS) are column names. But they can be functions (e.g. log) and transformations (e.g. interaction and factor crossing) too. The functions/transformations are symbolic and thus lazy.



Thanks so much!
3 days ago

Mike Simmons wrote:What I meant was, do you have a complete list of all possible values?  Are all values either s or t?  Do they range from a-z?  Or is there some other list, like C, M, T, S, X?

If all the values are s or t, then make all s = 0, and all t = 1.  That's easy.

If it's a range a-z, then ou can convert from the char to an int using math:


If it's a more random list like c, m, t, s, x or something, then go back to that labelIndices code I showed to make a more flexible way of mapping each unique label to an int.


Yes all values are either s or t
Thanks so much, ya I converted to using 0 and 1 and I was able to use it with the Sensitivity method I posted about as well

Mike Simmons wrote:Apparently, Sensitivity applies only to a binary classification, which means there are only two classes.In your example they are all 13 or 15, which is good.  However it looks like Smile enforces "binary" by saying the classes must be either 0 or 1.  So you could replace all 13 with 0, and all 15 with 1.   Or the other way around.  It doen't matter which you choose, as long as you remember what 0 means, and what 1 means, based on how you have converted the 13 and 15 to 0 or 1.


Amazing, thanks so much!
5 days ago
I'm using the smile library
and I'm trying to use the Sensitivity method to calculate the sensitivity of the machine learning prediction but I keep getting an error:

When I used the Accuracy method it did work and both take the same inputs.


truth is an int[] containing:

and pred is an int[] containing:

In Sensitivity.java I see:

but I don't really understand why it worked for Accuracy but not for Sensitivity.
5 days ago

Piet Souris wrote:A few topics ago you had this method (with a lambda!)  


I switched libraries and doesn't seem like this one offers an append option and similar way to get rows, I tried to use the lambda in a similar manner here but I couldn't get it working.

Piet Souris wrote:Did you not like that method?


Hahahaha, it was great!
5 days ago

Mike Simmons wrote:Regarding the last question, it doesn't look like you have a column named "height".  How can you drop the height column if there is no height column?


Sorry my original post wasn't so clear, the dataframe I posted was for the first part of the code in the libraries example, I didn't actually post my dataframe containing height.

I assume you have an array of labels, as Strings, where each String occurs exactly once.  (If not, you need to get something like that, either an array or List.)


Yes I do have an array of Strings but my array has 2 different letters repeated multiple times for the row it is associated with, it looks like:

I did try before to use a base36 system and change the letters to a number:

but then my array was like [29, 29, 29, 29, 29, 29, 29, 28, 28, 28, 28, 28] so wasn't really unique.