semvec/pypi-packages huggingface dataset:
housing-library-5512 0.1
Sample code for coding practice
Requires Python: >=3.11
Keywords: housing,data training

#This change is for the Pull request

# Median housing value prediction

The housing data can be downloaded from https://raw.githubusercontent.com/ageron/handson-ml/master/. The script has codes to download the data. We have modelled the median house value on given housing data. 

The following techniques have been used: 

 - Linear regression
 - Decision Tree
 - Random Forest

## Steps performed
 - We prepare and clean the data. We check and impute for missing values.
 - Features are generated and the variables are checked for correlation.
 - Multiple sampling techinuqies are evaluated. The data set is split into train and test.
 - All the above said modelling techniques are tried and evaluated. The final metric used to evaluate is mean squared error.

## To excute the script
python < scriptname.py >
mincluster 0.0.1
Cluster minimization package
Keywords: python,theoretical computer science,cluster


# mincluster

mincluster is a package that allows to minimize the maximum intercluster distance

## Overview

The problem of clustering a set of points so as to minimize the maximum intercluster distance is studied. An O(kn) approximation algorithm, where n is the number of points and k is the number of clusters, that guarantees solutions with an objective function value within two times the optimal solution value is presented. This approximation algorithm succeeds as long as the set of points satisfies the triangular inequality. We also show that our approximation algorithm is best possible, with respect to the approximation bound, if P ≠ NP.

## Installation

```python
pip install mincluster
```

## Usage

```python
from mincluster.cluster import ClusterMinimization

k = 3
data = [231, 22, 73, 54, 60, 29, 10, 192, 115]
c = ClusterMinimization(k, data)
clusters, cluster_heads = c.expand_clusters(c.clusters, c.cluster_heads)

try:
    for i in range(k):
        print(f'Cluster {i + 1}: Head = {cluster_heads[i]}, Elements = {clusters[i]}')
except IndexError as e:
        print(e)
```

### Output
```output
Cluster 1: Head = 60, Elements = {192, 231, 73, 10, 115, 54, 22, 29}
Cluster 2: Head = 231, Elements = {192, 231, 73, 10, 115, 54, 22, 60, 29}
Cluster 3: Head = 115, Elements = {192, 231, 73, 10, 115, 54, 22, 60, 29}
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## References

Gonzalez, Teofilo F. “Clustering to Minimize the Maximum Intercluster Distance.” Theoretical Computer Science, vol. 38, Elsevier BV, Jan. 1985, pp. 293–306, https://doi.org/10.1016/0304-3975(85)90224-5. Accessed 26 Oct. 2023.
YoloV2Keras 0.0.6
Yolo v2 library
Requires Python: >=3.7

# Yolov2keras

yolov2 implemented in tensorflow keras.


## Supported dataset formats:-

- Pascal Voc

## Models Available:-

- Yolo v2
- Mobilenet


## Train and Save
```py
import yolov2keras as yod 
import tensorflow as tf


train_image_dir="roboflow.voc/train/"
train_annotation_dir="roboflow.voc/train/"

val_image_dir="roboflow.voc/valid/"
val_annotation_dir="roboflow.voc/valid/"

# finding classnames of all the objects in the dataset
classnames_path = yod.dataset.VOCDataset.get_classnames_path(train_annotation_dir,val_annotation_dir)
yod.set_config(input_size=416,num_anchors=5,classnames_path=classnames_path)

# albumentations augmentations for making images a square
train_transform, val_transform, test_transform = yod.dataset.augmentations.default_augmentation()

# returns tf dataset objects
train_ds=yod.ParseDataset(train_image_dir,train_annotation_dir,format="PASCAL_VOC",augment=train_transform)
val_ds=yod.ParseDataset(val_image_dir,val_annotation_dir,format="PASCAL_VOC",augment=val_transform)

# finding the anchors of shape: (n,2)
anchors=yod.dataset.find_anchors(train_ds)
yod.set_anchors(anchors)

# convert to standard format to yolo v2 format
train_ds=yod.yoloDataset(train_ds,batch_size=4,drop_remainder=True)
val_ds=yod.yoloDataset(val_ds,batch_size=4)

# creating the model
# model = yod.models.get_model(basemodel="yolov2",pretrained=True)
model = yod.models.get_model(basemodel="mobilenet",pretrained=True)

optimizer = tf.keras.optimizers.Adam(learning_rate=1e-4, beta_1=0.9, beta_2=0.999, epsilon=1e-08)
metrics = [yod.metrics.iou_acc , yod.metrics.class_acc ] + [yod.losses.obj_loss,yod.losses.noobj_loss,yod.losses.box_loss,yod.losses.class_loss]
mapcallback = yod.callbacks.MAPCallback(val_ds,iou_thres=0.5,per_nth_epoch=1)

model.compile(optimizer=optimizer,loss=yod.losses.yolo_loss,metrics=metrics)

model.fit(train_ds,validation_data=val_ds,epochs=5,verbose=1,callbacks=[mapcallback])

# exporting the model
model_path="output/v1/"
yod.save(model_path,model)
```

## Inference

```py
import yolov2keras as yod 
import tensorflow as tf


model_path="output/v1/"

# object_detector = yod.load_model(model_path)
object_detector = yod.load_model_from_weights(model_path)
object_detector.set_config(p_thres=0.5,nms_thres=0.3,image_size=[416])

img="Sample.jpg"

detections = object_detector.predict(img)
print(detections)

yod.inference.helper.show_objects(img,detections)
```
scikit-bloom 0.1.1
Bloom tricks for text pipelines in scikit-learn.

# scikit-bloom

Bloom tricks for text pipelines in scikit-learn. To learn more about this trick, check out [this blogpost](https://explosion.ai/blog/bloom-embeddings).

You can install it via:

```
python -m pip install scikit-bloom
```

And you can import the components via: 

```python
from skbloom import BloomVectorizer, BloomishVectorizer
```

In fairness, while this trick is interesting ... you _might_ be fine just using the `HashingVectorizer` that just comes with sklearn.
streamlit-bordercontainer 0.0.8
a box which can set style easily
Requires Python: >=3.7

# streamlit-bordercontainer

a box which can set style easily

## Installation instructions 

```sh
pip install streamlit-bordercontainer
```

## Usage instructions

```python
import streamlit as st

from st_bordercontainer import st_bordercontainer

chatlist = [
      {
        "question": {
          "type": "img",
          "content":
            "https://static.openxlab.org.cn/landmarks/pc/footerbanner.png",
        },

        "user": "user"
      },
      {
        "response": {
          "type": "text",
          "content":
            "ou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like this",
        },
        "robot": "robot1"
      },
      {
        "response": {
          "type": "img",
          "content":
            "https://static.openxlab.org.cn/landmarks/pc/footerbanner.png",
        },

        "robot": "robot2"
      },
      {
        "question": {
          "type": "text",
          "content":
            "ou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like thisou'll most likely want to pass some data back to Python like this",
        },
        "user": "user2"
      }
]
value = st_bordercontainer(chatlist = chatlist,height=300)

st.write(value)