com.expleague.ml.io.JoinedProbsModelConversionPack Maven / Gradle / Ivy
package com.expleague.ml.io;
import com.expleague.commons.func.types.ConversionPack;
import com.expleague.commons.math.Func;
import com.expleague.commons.util.ArrayTools;
import com.expleague.ml.models.multiclass.JoinedProbsModel;
/**
* User: qdeee
* Date: 31.07.14
*/
public class JoinedProbsModelConversionPack implements ConversionPack {
public static class To extends TransJoinConversionPack.BaseTo {
@Override
public CharSequence convert(final JoinedProbsModel from) {
return convertModels(from);
}
}
public static class From extends TransJoinConversionPack.BaseFrom {
@Override
public JoinedProbsModel convert(final CharSequence from) {
final Func[] dirs = ArrayTools.map(convertModels(from), Func.class, argument -> (Func) argument);
return new JoinedProbsModel(dirs);
}
}
@Override
public Class to() {
return To.class;
}
@Override
public Class from() {
return From.class;
}
}