smile icon indicating copy to clipboard operation
smile copied to clipboard

Need guidance to move from smile-core 4.1.0 to 4.2.0.

Open wernkoe opened this issue 6 months ago • 4 comments

I am trying to move from smile-core 4.1.0 to 4.2.0. I encountered the following message in Eclipse-Java. I am not sure if this is a bug. More likely incompatible dependencies in my Maven set up. I need some guidance.

I am using JavaSE-21.

Thanks in advance, Wern

Exception in thread "Thread-1" java.lang.NoSuchFieldError: Class smile.data.type.DataTypes does not have member field 'smile.data.type.IntegerType IntegerType' at tech.tablesaw.conversion.smile.SmileConverter.toSmileType(SmileConverter.java:70)

I have the following dependencies. <groupId>tech.tablesaw</groupId> <artifactId>tablesaw-core</artifactId> 0.44.1 <groupId>tech.tablesaw</groupId> <artifactId>tablesaw-smile</artifactId> 0.32.1 ...... <groupId>com.github.haifengl</groupId> <artifactId>smile-core</artifactId> 4.2.0

wernkoe avatar Jun 12 '25 04:06 wernkoe

The above error pointed to the part when I tried to convert tablesaw to smile using table.smile().toDataFrame(). Does that mean the SmileConverter in tablsaw is no longer matching with smile-core of 4.2.0?

wernkoe avatar Jun 12 '25 14:06 wernkoe

I think I found the cause but I am not sure if I know how to make them compatible. I think SmileConverter in tablesaw-core has not been updated to handle IntType. It is converting "INTEGER" to IntegerType instead of IntType and smile-core 4.2.0 does not have IntegerType. Please kindly advise what to do. Thanks in advance.

Wern

In 4.1.0 of smile-core, public class DataTypes { /** Boolean data type. / public static final smile.data.type.BooleanType BooleanType = smile.data.type.BooleanType.instance; /* Char data type. / public static final smile.data.type.CharType CharType = smile.data.type.CharType.instance; /* Byte data type. / public static final smile.data.type.ByteType ByteType = smile.data.type.ByteType.instance; /* Short data type. / public static final smile.data.type.ShortType ShortType = smile.data.type.ShortType.instance; /* Integer data type. */ public static final IntegerType IntegerType = smile.data.type.IntegerType.instance; ......

In 4.2.0 of smile-core, public class DataTypes { /** Boolean data type. / public static final smile.data.type.BooleanType BooleanType = new smile.data.type.BooleanType(false); /* Char data type. / public static final smile.data.type.CharType CharType = new smile.data.type.CharType(false); /* Byte data type. / public static final smile.data.type.ByteType ByteType = new smile.data.type.ByteType(false); /* Short data type. / public static final smile.data.type.ShortType ShortType = new smile.data.type.ShortType(false); /* Integer data type. */ public static final smile.data.type.IntType IntType = new smile.data.type.IntType(false); ......

wernkoe avatar Jun 13 '25 04:06 wernkoe

DataFrame is fully re-designed with smile 4.2. Please check out Data Processing for a tutorial of the new API. You should be able to do what you can do with pandas or tablsaw.

haifengl avatar Jun 14 '25 15:06 haifengl

Thanks for the quick reply. I have read the Data Processing page. I think I can make it working by doing my own conversion from tablesaw to dataFrame of Smile. However, I was hoping I could just call the SmileConverter or similar method, just like 4.1.0 or earlier version. I will look into my own conversion while waiting for the other thread (https://github.com/jtablesaw/tablesaw/issues/1295) to reply. Thanks a lot.

wernkoe avatar Jun 14 '25 21:06 wernkoe