haifengl on master
fix javadoc (compare)
haifengl on master
move ica package to smile.ica i… (compare)
haifengl on master
refactor KPCA remove Projection rename LinearProjection to Proj… (compare)
haifengl on master
extend DataFrame.toArray(column… refactor LinearProjection fix arpack and 2 more (compare)
haifengl on master
add KMedoidsImputer and remove … (compare)
haifengl on master
fix missing value detection bug (compare)
haifengl on master
refactor SVDImputer refactor LLSImputer refactor imputation test and 1 more (compare)
haifengl on master
move names()/type()/measures() … add KNNImputer (compare)
@haifengl,
and user/developers
Hello,
SMILE is great product.
If you do not mind,please tell me how to do Group KFolds CrossValidation.
I found "GroupKFold" in API:http://haifengl.github.io/api/java/smile/validation/GroupKFold.html.
Then, I tried it, but I do not know following procedures,
1.I want to use SVM, what should I do/set parameters ?
int[] pred = new GropuKFold(1000,10,groups).classification(df, (??, ??) -> SVM.fit(????));
2.If I want visualize ROC curve, and calculate auc of each k, how to do that? When I use scikit-learn's GroupedkFold, I can load each folds dataset and can visualize all folds ROC with auc. By SMILE, how to perform?
Best regards,
@haifengl
Hi, I have one question,
Or, my code is wrong ? (If so, so sory...)
Validation code is following,
int[] truth = new int[] {0,0,0,0,0,1,1,1,1,1};
int[] pred = new int[] {1,0,0,1,0,1,1,1,1,0};
ConfusionMatrix mtx = ConfusionMatrix.of(truth, pred);
System.out.println(mtx.toString());
int[][] mat = mtx.matrix;
double tn = mat[0][0];//tn
double fn = mat[0][1];//fn
double fp = mat[1][0];//fp
double tp = mat[1][1];//tp
double ppv = tp/(tp+fp);
double tpr = tp/(tp+fn);
double npv = tn/(tn+fn);
double spc = tn/(fp+tn);
System.out.println("TPR is "+tpr);//0.66
System.out.println("PPV is "+ppv);//0.8
System.out.println("SPC is "+spc);//0.75
System.out.println("NPV is "+npv);//0.6
System.out.println("Sensitivity is "+Sensitivity.of(truth, pred));//0.8
System.out.println("Specificity is "+Specificity.of(truth, pred));//0.6
HI Everyone, sorry for the newbie question but I'm kinda stuck here and didn't find a good way to work around the problem.
Basically I'm just trying to create a DataFrame from a SQL query but I keep getting an error:
val url = "jdbc:postgresql://localhost/test"
val props = Properties()
props.setProperty("user", "test")
props.setProperty("password", "test")
val conn: Connection = DriverManager.getConnection(url, props)
val rs = conn.createStatement().executeQuery("select 1 from homes")
val df = DataFrame.of(rs)
println(df)
and the error:
Exception in thread "main" java.lang.IllegalArgumentException: No enum constant java.sql.JDBCType.int4
at java.base/java.lang.Enum.valueOf(Enum.java:240)
at java.sql/java.sql.JDBCType.valueOf(JDBCType.java:34)
at smile.data.type.DataTypes.struct(DataTypes.java:168)
at smile.data.type.DataTypes.struct(DataTypes.java:158)
at smile.data.DataFrame.of(DataFrame.java:1261)
I'm using org.postgresql:postgresql:42.2.12
Hi hifeng, I tried to use MultivariateGaussianMixture but have the following exception:
Warning: Could not load Loader: java.lang.UnsatisfiedLinkError: no jnijavacpp in java.library.path
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopenblas_nolapack in java.library.path
I import the dependency in maven like this:
<dependency>
<groupId>com.github.haifengl</groupId>
<artifactId>smile-core</artifactId>
<version>2.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bytedeco/javacpp -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>1.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bytedeco/openblas -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>openblas</artifactId>
<version>0.3.9-1.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bytedeco/arpack-ng -->
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>arpack-ng</artifactId>
<version>3.7.0-1.5.3</version>
</dependency>
new_col = lambda each_row: math.sqrt((3*each_row.first_column)**4 + (3*each_row.second_column)**4+ (3*each_row.third_column)**4)
my_dataframe.apply(new_col)
import smile.data.formula.Formula;
import static smile.data.formula.Terms.*;
df.stream().map(row -> {
or something?
The response variable Classification doesn't exist in the schema [...]
. Should I pay attention to this message? How do I get rid of it?
sterr = true