Pickle型号根据其功能设置

时间:2018-04-25 13:48:10

标签: scikit-learn pickle

我有一个REST服务,它将分类器应用于用户数据。我将我的特征空间子集化,并根据用户数据中可用的特征子集训练模型。我想在模型创建后缓存/挑选模型。如何存储这些模型以便我可以随时恢复正确的模型?

一个模型可能是:

Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .baseUrl("https://preprod.itineraire.sanilea.tech/api/v1/")
                .client(get())
                .build()

 retrofit.create(RestApi::class.java)
            .login(UserManager.username, UserManager.password, editextToken.text.toString().toInt())
            .subscribeOn(Schedulers.newThread())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(

                    {

                        updateUiLogin()


                        val token = JwtManager.decodeTokenClaims(it)
                        UserManager.jwtToken = it

                        toast("Connexion réussis")

                    },
                    { e ->

                        e as HttpException
                        updateUiLogin()

                        toast(R.string.an_error_occured)
                        Log.w(TAG, e.message())
                    }
            )

和另一个模型可能由以下人员定义:

['feature1', 'feature2', 'feature10'] 

我正在考虑散列这个列表,然后用:

来挑选模型
['feature1', 'feature9']. 

这是否合适?我是否总能收回预期的型号?挑选Dict [Set [features],model]类型的词典会不会更好?

0 个答案:

没有答案